Created
January 23, 2017 09:54
-
-
Save tlossen/2b2a11cec79e395fdc26d933d69fc7c4 to your computer and use it in GitHub Desktop.
playing around with the siberite ruby client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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