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



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

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

#handle_subscribeObject



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

alias handle_subscribe subscribe_to_channel

#stop_all_streamsObject



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

def stop_all_streams
  connection.socket.unsubscribe_from_all identifier
end

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



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

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



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

def subscribe_to_channel
  # noop
end