Skip to content

Instantly share code, notes, and snippets.

View dannolan's full-sized avatar
😄
loged on

Dan Nolan dannolan

😄
loged on
View GitHub Profile
@mloughran
mloughran / pubsub_example.rb
Created September 14, 2011 15:05
em-hiredis pubsub example
require 'em-hiredis'
EM.run {
require 'em-hiredis'
redis = EM::Hiredis.connect
# If you pass a block to subscribe it will be called whenever a message
# is received on this channel
redis.pubsub.subscribe('foo') { |msg|
p [:received_foo, msg]