normandy/examples/range_over_channels.rb
2015-08-03 13:50:05 +02:00

10 lines
159 B
Ruby

# https://gobyexample.com/range-over-channels
require 'channel'
queue = Channel.new(2)
queue << 'one'
queue << 'two'
close(queue)
queue.each { |e| puts e }