Class: ActionCable::Channel::Base
- Inherits:
-
Object
- Object
- ActionCable::Channel::Base
- Defined in:
- lib/anycable/rails/actioncable/channel.rb
Overview
:nodoc:
Instance Method Summary collapse
- #delegate_connection_identifiers ⇒ Object
- #handle_subscribe ⇒ Object
- #stop_all_streams ⇒ Object
- #stream_from(broadcasting, callback = nil, coder: nil) ⇒ Object
- #subscribe_to_channel ⇒ Object
Instance Method Details
#delegate_connection_identifiers ⇒ Object
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_subscribe ⇒ Object
7 |
# File 'lib/anycable/rails/actioncable/channel.rb', line 7 alias handle_subscribe subscribe_to_channel |
#stop_all_streams ⇒ Object
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_channel ⇒ Object
11 12 13 |
# File 'lib/anycable/rails/actioncable/channel.rb', line 11 def subscribe_to_channel # noop end |