Skip to content

Instantly share code, notes, and snippets.

@tlossen
Created January 23, 2017 09:54
Show Gist options
  • Save tlossen/2b2a11cec79e395fdc26d933d69fc7c4 to your computer and use it in GitHub Desktop.
Save tlossen/2b2a11cec79e395fdc26d933d69fc7c4 to your computer and use it in GitHub Desktop.
playing around with the siberite ruby client
require 'siberite-client'
prefix = ARGV[0]
Thread.new do
queue = Siberite::Client.new('localhost:22133', 'localhost:22144')
i = 0
loop do
i += 1
item = "#{prefix}#{i}"
queue.set('test', item)
puts "published: #{item}"
end
end
queue2 = Siberite::Client.new('localhost:22133', 'localhost:22144')
loop do
item = queue2.get('test')
puts "received: #{item}" if item
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment