Class: Async::Redis::SentinelsClient
- Defined in:
- lib/async/redis/sentinels.rb
Instance Attribute Summary
Attributes inherited from Client
Instance Method Summary collapse
-
#initialize(master_name, sentinels, role = :master, protocol = Protocol::RESP2, **options) ⇒ SentinelsClient
constructor
A new instance of SentinelsClient.
Methods inherited from Client
#call, #close, open, #pipeline, #subscribe, #transaction
Constructor Details
#initialize(master_name, sentinels, role = :master, protocol = Protocol::RESP2, **options) ⇒ SentinelsClient
Returns a new instance of SentinelsClient.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/async/redis/sentinels.rb', line 10 def initialize(master_name, sentinels, role = :master, protocol = Protocol::RESP2, **) @master_name = master_name @sentinel_endpoints = sentinels.map do |sentinel| Async::IO::Endpoint.tcp(sentinel[:host], sentinel[:port]) end @role = role @protocol = protocol @pool = connect(**) end |