/usr/lib/ruby/vendor_ruby/em-synchrony/fiber_iterator.rb is in ruby-em-synchrony 1.0.5-2ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | module EventMachine
module Synchrony
class FiberIterator < EM::Synchrony::Iterator
# execute each iterator block within its own fiber
# and auto-advance the iterator after each call
def each(foreach=nil, after=nil, &blk)
fe = Proc.new do |obj, iter|
Fiber.new { (foreach || blk).call(obj, iter); iter.next }.resume
end
super(fe, after)
end
end
end
end
|