ruby/ruby — pull request #361 by avdi (2013-07-15 06:49:50+00:00)
Title: Add Queue#each.

I am sure there is an excellent reason `Queue` doesn't support `#each`. But not knowing what that reason is, I went and implemented it. Why? Well, it's awfully convenient for writing simple consumers:

```ruby
in = Queue.new
out = Queue.new
doubler = Thread.new do
in.each |n| do
out << n + n
end
end
```

It also opens up the possibility of making `Queue` `Enumerable`, but I'm not opening that can of worms in this PR.