class EventMachine::Synchrony::Iterator

def each(foreach=nil, after=nil, &blk)

on the fly (see iterator documentation in EM)
means that you loose ability to choose concurrency
jobs are done before returning. Unfortunately this
synchronous iterator which will wait until all the
def each(foreach=nil, after=nil, &blk)
  fiber = Fiber.current
  fe = (foreach || blk)
  cb = Proc.new do
    after.call if after
    fiber.resume
  end
  Fiber.yield super(fe, cb)
end

def inject(obj, foreach = nil, after = nil, &block)

def inject(obj, foreach = nil, after = nil, &block)
  if foreach and after
    super(obj, foreach, after)
  else
    fiber = Fiber.current
    result = nil
    after = Proc.new {|res| result = res; fiber.resume}
    super(obj, block, after)
    Fiber.yield
    result
  end
end

def map(&block)

def map(&block)
  fiber = Fiber.current
  result = nil
  after = Proc.new {|res| result = res; fiber.resume }
  super(block, after)
  Fiber.yield
  result
end