eventmachine/eventmachine — pull request #310 by funny-falcon (2012-03-26 13:00:10+00:00)
Title: WorkerQueue - simpler parrallel worker

EM::WorkerQueue is based on EM::Iterator and EM::Queue ideas, but has simpler workflow

````
worker = EM::WorkerQueue.new(:concurency=>4){|v, iter|
EM.add_timer(1){ puts v; iter.done}
}
10.times{|i| worker.push i}
````

Also it supplies pull interface
````
queue = Queue.new
worker = EM::WorkerQueue.new(:concurency=>4){|v, iter|
EM.add_timer(1){ puts v; iter.done}
}
worker.on_empty{ queue.pop{|v| worker.push(v) } }
10.times{|i| queue.push i}
````

EM::Iterator could be implemented on top of EM::WorkerQueue, such implementation provided