Module Moped::ReadPreference
In: lib/moped/read_preference.rb
lib/moped/read_preference/secondary.rb
lib/moped/read_preference/secondary_preferred.rb
lib/moped/read_preference/nearest.rb
lib/moped/read_preference/primary.rb
lib/moped/read_preference/selectable.rb
lib/moped/read_preference/primary_preferred.rb

Provides behaviour around getting various read preference implementations.

@since 2.0.0

Methods

get  

Classes and Modules

Module Moped::ReadPreference::Selectable
Class Moped::ReadPreference::Nearest
Class Moped::ReadPreference::Primary
Class Moped::ReadPreference::PrimaryPreferred
Class Moped::ReadPreference::Secondary
Class Moped::ReadPreference::SecondaryPreferred

Constants

PREFERENCES = { nearest: Nearest, primary: Primary, primary_preferred: PrimaryPreferred, secondary: Secondary, secondary_preferred: SecondaryPreferred   Hash lookup for the read preference classes based off the symbols provided in configuration.

@since 2.0.0

Public Instance methods

Get a read preference for the provided name. Valid names are:

  - :nearest
  - :primary
  - :primary_preferred
  - :secondary
  - :secondary_preferred

@example Get the primary read preference.

  Moped::ReadPreference.get(:primary)

@param [ Symbol ] name The name of the preference. @param [ Array<Hash> ] tags The tag sets to match the node on.

@return [ Object ] The appropriate read preference.

@since 2.0.0

[Validate]