Class: ActionCable::Channel::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/anycable/rails/actioncable/channel.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#delegate_connection_identifiersObject



25
26
27
28
29
30
31
# File 'lib/anycable/rails/actioncable/channel.rb', line 25

def delegate_connection_identifiers
  connection.identifiers.each do |identifier|
    define_singleton_method(identifier) do
      connection.fetch_identifier(identifier)
    end
  end
end

#handle_subscribeObject



8
# File 'lib/anycable/rails/actioncable/channel.rb', line 8

alias handle_subscribe subscribe_to_channel

#stop_all_streamsObject



21
22
23
# File 'lib/anycable/rails/actioncable/channel.rb', line 21

def stop_all_streams
  connection.socket.unsubscribe_from_all identifier
end

#stream_from(broadcasting, callback = nil, coder: nil) ⇒ Object



16
17
18
19
# File 'lib/anycable/rails/actioncable/channel.rb', line 16

def stream_from(broadcasting, callback = nil, coder: nil)
  raise ArgumentError('Unsupported') if callback.present? || coder.present? || block_given?
  connection.socket.subscribe identifier, broadcasting
end

#subscribe_to_channelObject



12
13
14
# File 'lib/anycable/rails/actioncable/channel.rb', line 12

def subscribe_to_channel
  # noop
end