Class: RedisClient::PubSub
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb
Instance Method Summary collapse
- #call(*command, **kwargs) ⇒ Object
- #call_v(command) ⇒ Object
- #close ⇒ Object
-
#initialize(raw_connection, command_builder) ⇒ PubSub
constructor
A new instance of PubSub.
- #next_event(timeout = nil) ⇒ Object
Constructor Details
#initialize(raw_connection, command_builder) ⇒ PubSub
Returns a new instance of PubSub.
415 416 417 418 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 415 def initialize(raw_connection, command_builder) @raw_connection = raw_connection @command_builder = command_builder end |
Instance Method Details
#call(*command, **kwargs) ⇒ Object
420 421 422 423 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 420 def call(*command, **kwargs) raw_connection.write(@command_builder.generate(command, kwargs)) nil end |
#call_v(command) ⇒ Object
425 426 427 428 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 425 def call_v(command) raw_connection.write(@command_builder.generate(command)) nil end |
#close ⇒ Object
430 431 432 433 434 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 430 def close @raw_connection&.close @raw_connection = nil self end |
#next_event(timeout = nil) ⇒ Object
436 437 438 439 440 441 442 443 444 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/redis-client-0.12.0/lib/redis_client.rb', line 436 def next_event(timeout = nil) unless raw_connection raise ConnectionError, "Connection was closed or lost" end raw_connection.read(timeout) rescue ReadTimeoutError nil end |