jridgewell/Going — pull request #17 by jridgewell (2014-09-30 03:24:41+00:00)
Title: Emulate `Enumerator.new` syntax

You can now pass a block to `#initialize`, and it will act like an
`Enumerator`.

```ruby
channel = Going::Channel.new do |ch|
1000.times do |i|
ch.yield i
end
end

channel.next #=> 0
channel.next #=> 1
channel.next #=> 2
channel.each.to_a #=> [3, 4, 5, …, 999]
channel.closed? #=> true
```