making room for future tees (e.g fork_, thread_)

This commit is contained in:
Loic Nageleisen 2012-11-06 16:48:15 +01:00
parent 755bd3bc11
commit 31d6fa48c0

3
tee.rb
View file

@ -30,7 +30,7 @@ class IO
end end
module Utils module Utils
def tee(*procs) def fiber_tee(*procs)
ios = procs.map { |proc| FiberChunkedIO.new &proc } ios = procs.map { |proc| FiberChunkedIO.new &proc }
chunks.each do |chunk| chunks.each do |chunk|
@ -41,6 +41,7 @@ class IO
ios.each { |io| io.close } ios.each { |io| io.close }
ios.map { |io| io.result } ios.map { |io| io.result }
end end
alias_method :tee, :fiber_tee
end end
include Chunkable include Chunkable