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, #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, **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