A Ruby implementation of socket.io-emitter.
require 'socket.io-emitter'
emitter = SocketIO::Emitter.new
emitter.emit('time', DateTime.now.to_s)
Add this line to your application's Gemfile:
gem 'socket.io-emitter'
And then execute:
$ bundle
Or install it yourself as:
$ gem install socket.io-emitter
The following options are allowed:
- key: the name of the key to pub/sub events on as prefix (
socket.io
) - redis: the Instance of Redis (
redis://127.0.0.1:6379/0
)
Specifies a specific room that you want to emit to.
Alias of Emitter#to
.
Specifies a specific namespace that you want to emit to.
MIT