class Transformer::SecondYielder

Public Class Methods

new(y, fiber) click to toggle source
# File lib/coroutines/base.rb, line 566
def initialize(y, fiber)
        @y, @fiber = y, fiber
end

Public Instance Methods

<<(*args)
Alias for: yield
await() click to toggle source
# File lib/coroutines/base.rb, line 571
def await
        raise StopIteration unless @fiber.alive?
        tag, result = @fiber.resume
        while tag == :await do
                x = nil
                begin
                        x = @y.await
                rescue Exception => e
                        tag, result = @fiber.raise(e)
                end
                tag, result = @fiber.resume(*x) unless x.nil?
                raise StopIteration unless @fiber.alive?
        end
        result
end
yield(*args) click to toggle source
# File lib/coroutines/base.rb, line 603
def yield(*args)
        @y.yield(*args)
        self
end
Also aliased as: <<