Sha256: 15df772cdb419213ca314736317971db94daaca476b3fd14119bf48beb4deb4a

Contents?: true

Size: 437 Bytes

Versions: 2

Compression:

Stored size: 437 Bytes

Contents

module ActiveJobChannel
  class Channel < ::ActionCable::Channel::Base
    CHANNEL_NAME = 'active_job_channel'.freeze

    def subscribed
      stream_from CHANNEL_NAME
      stream_from private_stream if connection.connection_identifier.present?
    end

    private

    def global_stream
      stream_from CHANNEL_NAME
    end

    def private_stream
      [CHANNEL_NAME, connection.connection_identifier].join('#')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_job_channel-0.3.0 lib/active_job_channel/channel.rb
active_job_channel-0.0.3 lib/active_job_channel/channel.rb