Module: Bones::RPC::ReadPreference
- Extended by:
- ReadPreference
- Included in:
- ReadPreference
- Defined in:
- lib/bones/rpc/read_preference.rb,
lib/bones/rpc/read_preference/nearest.rb,
lib/bones/rpc/read_preference/selectable.rb
Overview
Provides behaviour around getting various read preference implementations.
Defined Under Namespace
Modules: Selectable Classes: Nearest
Constant Summary collapse
- PREFERENCES =
Hash lookup for the read preference classes based off the symbols provided in configuration.
{ nearest: Nearest }.freeze
Instance Method Summary collapse
-
#get(name, tags = nil) ⇒ Object
Get a read preference for the provided name.
Instance Method Details
#get(name, tags = nil) ⇒ Object
Get a read preference for the provided name. Valid names are:
- :nearest
- :primary
- :primary_preferred
- :secondary
- :secondary_preferred
38 39 40 |
# File 'lib/bones/rpc/read_preference.rb', line 38 def get(name, = nil) PREFERENCES.fetch(name.to_sym).new() end |