Skip to content

Instantly share code, notes, and snippets.

@fbjork
Created September 15, 2011 05:09
Show Gist options
  • Save fbjork/1218592 to your computer and use it in GitHub Desktop.
Save fbjork/1218592 to your computer and use it in GitHub Desktop.
PUBNUB_QUEUE = GirlFriday::WorkQueue.new(:pubnub, size: 3) do |msg|
pubnub = Pubnub.new(TestApp::Application.config.pubnub_publish_key, TestApp::Application.config.pubnub_subscribe_key, TestApp::Application.config.pubnub_secret_key, false)
pubnub.publish({'channel' => msg[:channel], 'message' => msg[:message]})
end
# Here's how I push to the queue:
PUBNUB_QUEUE.push(channel: "room/123", message: {text: 'hello'})
# This is the gem code:
https://github.com/pubnub/pubnub-api/tree/master/ruby/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment