Class: BroadcastHub::StreamChannel

Inherits:
ApplicationCable::Channel
  • Object
show all
Defined in:
app/channels/broadcast_hub/stream_channel.rb

Overview

Action Cable channel that subscribes clients to authorized BroadcastHub streams.

Instance Method Summary collapse

Instance Method Details

#subscribedvoid

This method returns an undefined value.

Starts stream subscription for the current channel connection.



9
10
11
12
13
14
# File 'app/channels/broadcast_hub/stream_channel.rb', line 9

def subscribed
  stream_from(BroadcastHub::StreamKeyResolver.resolve!(stream_key_context))
rescue BroadcastHub::StreamKeyResolver::Unauthorized => e
  logger.info("broadcast_hub.reject reason=#{e.message}") if defined?(Rails) && Rails.env.development?
  reject
end