-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow preferring a specified stream in queue.Read
By default the queue client's Read method uses an approach to reading multi-stream queues that attempts to share the consumer resources fairly between all the streams. This commit adds a PreferStream field to queue.ReadArgs which, if it identifies a valid stream in the queue, is checked in preference to all other streams. If PreferStream is empty, or no messages can be found in PreferStream within the specified Block time, Read will fall back to checking all other streams in the queue. The client is expected to keep track of the value of Stream returned in the most recent Message and pass that back in as the value of PreferStream. This read behavior is most useful in the context of hotswaps, where each stream represents a specific workload (i.e. a specific value of "replicate_weights"). We can create "affinity" between a specific workload and a specific instance (or instances) of director by reading greedily from the same stream as much as possible. Co-authored-by: F <[email protected]>
- Loading branch information
1 parent
5468067
commit 02d966d
Showing
3 changed files
with
172 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters