-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Sentinel preferredSlaves option (#370)
* Support for “preferredSlave” when connecting to a Sentinel group for local reads in a distributed environment. Value can be an array of objects with required properties “ip” and “port” and option property of “prio” indicating the priority, defaults to 1, lower numbers preferred first. If the value is a function the available slaves are passed into it, expecting a single slave as the response. If no preferred slave is found a random one is returned from those available. Updated tests to return bad values in SENTINEL slaves command but still select the correct one based on the preferredSlave result. * Update README with details on the `preferredSlaves` option.
- Loading branch information
1 parent
8718567
commit 6ddcc99
Showing
3 changed files
with
163 additions
and
4 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