Distributed Ruby

Queue


DRb.start_service('druby://localhost:9999', Queue.new)
DRb.thread.join
  

Producer


DRb.start_service
queue = DRbObject.new_with_uri('druby://localhost:9999')
queue.push(7)
  

Consumer


DRb.start_service
queue = DRbObject.new_with_uri('druby://localhost:9999')
loop do
  data = queue.pop
  puts "Processing #{data}"
end