Sha256: 22379780aa6398d56fde4859429efdd5287a5c48d1c9c1eb79f90a19d5b2eb2c

Contents?: true

Size: 340 Bytes

Versions: 11

Compression:

Stored size: 340 Bytes

Contents

module Sinatra
  module RocketIO

    def self.channels
      @@channels ||= {}
    end

  end
end

Sinatra::RocketIO.on :__channel_id do |channel, client|
  channels[client[:session]] = channel
  client.channel = channel
  emit :connect, client
end
Sinatra::RocketIO.on :disconnect do |client, type|
  channels.delete client[:session]
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sinatra-rocketio-0.3.3 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.3.2 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.3.1 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.3.0 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.2.6 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.2.5 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.2.4 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.2.3 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.2.2 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.2.1 lib/sinatra-rocketio/channel.rb
sinatra-rocketio-0.2.0 lib/sinatra-rocketio/channel.rb