class RedisClient::PubSub
Attributes
Public Class Methods
Source
# File lib/redis_client.rb, line 487 def initialize(raw_connection, command_builder) @raw_connection = raw_connection @command_builder = command_builder end
Public Instance Methods
Source
# File lib/redis_client.rb, line 492 def call(*command, **kwargs) raw_connection.write(@command_builder.generate(command, kwargs)) nil end
Source
# File lib/redis_client.rb, line 497 def call_v(command) raw_connection.write(@command_builder.generate(command)) nil end
Source
# File lib/redis_client.rb, line 502 def close @raw_connection&.close @raw_connection = nil # PubSub can't just reconnect self end
Source
# File lib/redis_client.rb, line 508 def next_event(timeout = nil) unless raw_connection raise ConnectionError, "Connection was closed or lost" end raw_connection.read(timeout) rescue ReadTimeoutError nil end