Module: Resque::Plugins::Pubsub::Publisher::InstanceMethods

Defined in:
lib/resque/plugins/pubsub/publisher.rb

Instance Method Summary collapse

Instance Method Details

#publish(topic, message) ⇒ Object



12
13
14
15
16
# File 'lib/resque/plugins/pubsub/publisher.rb', line 12

def publish(topic, message)
  puts "[#{self.class.to_s}] publishing #{message} in #{topic}"
  Exchange.redis.sadd(:queues, 'messages')
  Exchange.redis.rpush('queue:messages', { :class => 'Resque::Plugins::Pubsub::Broker', :args => [topic, message] }.to_json)
end