class EventMachine::Synchrony::FiberIterator

Public Instance Methods

each(foreach=nil, after=nil, &blk) click to toggle source

execute each iterator block within its own fiber and auto-advance the iterator after each call

Calls superclass method
# File lib/em-synchrony/fiber_iterator.rb, line 8
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