Class: Async::Redis::SentinelsClient

Inherits:
Client
  • Object
show all
Defined in:
lib/async/redis/sentinels.rb

Instance Attribute Summary

Attributes inherited from Client

#endpoint, #protocol

Instance Method Summary collapse

Methods inherited from Client

#call, #close, open, #pipeline, #publish, #subscribe, #transaction

Constructor Details

#initialize(master_name, sentinels, role = :master, protocol = Protocol::RESP2, **options) ⇒ SentinelsClient



6
7
8
9
10
11
12
13
14
15
# File 'lib/async/redis/sentinels.rb', line 6

def initialize(master_name, sentinels, role = :master, protocol = Protocol::RESP2, **options)
  @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(**options)
end