Eric Hodel wrote:
> On Dec 10, 2006, at 24:50 , Boris Mojo-jojo wrote:
> 
>> Please advise on how to implement multiple select from queues in  
>> Ruby. I
>> have seen only selcet which operates on IO streams. I need to pass
>> objects not symbols. I have 100 queues and I must wait when message
>> appears on one of them.
> 
> ri Queue ?
> 
> --
> Eric Hodel - drbrain / segment7.net - http://blog.segment7.net
> 
> I LIT YOUR GEM ON FIRE!

Sorry but no info on select in ri. Look for yourslef

C:\ruby\bin>ri Queue
----------------------------------------------------------- Class: Queue
     This class provides a way to synchronize communication between
     threads.

     Example:

       require 'thread'

       queue = Queue.new

       producer = Thread.new do
         5.times do |i|
           sleep rand(i) # simulate expense
           queue << i
           puts "#{i} produced"
         end
       end

       consumer = Thread.new do
         5.times do |i|
           value = queue.pop
           sleep rand(i/2) # simulate expense
           puts "consumed #{value}"
         end
       end

       consumer.join

------------------------------------------------------------------------


Class methods:
--------------
     new


Instance methods:
-----------------
     <<, clear, deq, empty?, enq, length, num_waiting, pop, push, shift,
     size

-- 
Posted via http://www.ruby-forum.com/.