Sha256: 01659bba6f34ea427d8229b93335f568269a0020cf67acd06ed5dbe6f8046e94

Contents?: true

Size: 399 Bytes

Versions: 1

Compression:

Stored size: 399 Bytes

Contents

require 'action_cable'

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 private_stream
      [CHANNEL_NAME, connection.connection_identifier].join('#')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_job_channel-0.4.0 lib/active_job_channel/channel.rb