Provides behaviour around getting various read preference implementations.
@since 2.0.0
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 |
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