Class: ActionCable::SubscriptionAdapter::Redis::Listener::SubscribedClient
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actioncable/lib/action_cable/subscription_adapter/redis.rb |
Class Method Summary
- .new(raw_client) ⇒ SubscribedClient constructor
Instance Method Summary
Constructor Details
.new(raw_client) ⇒ SubscribedClient
# File 'actioncable/lib/action_cable/subscription_adapter/redis.rb', line 216
def initialize(raw_client) @raw_client = raw_client end
Instance Method Details
#send_command(*command) (private)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/redis.rb', line 229
def send_command(*command) @raw_client.write(command) very_raw_connection = @raw_client.connection.instance_variable_defined?(:@connection) && @raw_client.connection.instance_variable_get(:@connection) if very_raw_connection && very_raw_connection.respond_to?(:flush) very_raw_connection.flush end nil end
#subscribe(*channel)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/redis.rb', line 220
def subscribe(*channel) send_command("subscribe", *channel) end
#unsubscribe(*channel)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/redis.rb', line 224
def unsubscribe(*channel) send_command("unsubscribe", *channel) end