Module: AsyncCable

Defined in:
lib/async_cable.rb,
lib/async_cable/util.rb,
lib/async_cable/config.rb,
lib/async_cable/errors.rb,
lib/async_cable/server.rb,
lib/async_cable/version.rb,
lib/async_cable/registry.rb,
lib/async_cable/connection.rb

Defined Under Namespace

Modules: Errors, Util Classes: Config, Connection, Registry, Server

Constant Summary collapse

VERSION =
'0.2.3'

Class Method Summary collapse

Class Method Details

.broadcast(data) ⇒ Object

Transmit data to all WS connections.

Parameters:

  • data (Hash)


23
24
25
26
# File 'lib/async_cable.rb', line 23

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

.configAsync::Config

Returns:

  • (Async::Config)


12
13
14
# File 'lib/async_cable.rb', line 12

def config
  @config ||= Config.new
end

.configure {|Async::Config| ... } ⇒ Object

Yields:

  • (Async::Config)


17
18
19
# File 'lib/async_cable.rb', line 17

def configure
  yield config
end