Sha256: 60cb4672dc0f3ee280540be793164c00d8d6db4015cd3358e038895c2771da77

Contents?: true

Size: 547 Bytes

Versions: 1

Compression:

Stored size: 547 Bytes

Contents

require 'async_cable/version'
require 'async_cable/errors'
require 'async_cable/config'
require 'async_cable/registry'
require 'async_cable/connection'
require 'async_cable/server'

module AsyncCable
  def config
    @config ||= Config.new
  end

  def configure
    yield config
  end

  def broadcast(data)
    config.logger.debug { "#{name}.broadcast data=#{data.inspect}" }
    Registry.each { |conn| conn.transmit(data) }
  end

  module_function :configure, :config, :broadcast
  config # initialize config right away to prevent racing.
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
async_cable-0.2.0 lib/async_cable.rb