module Asynchro::Extensions

Public Instance Methods

async_state(&block) click to toggle source
# File lib/asynchro/extensions.rb, line 6
def async_state(&block)
  Asynchro::State.new(&block)
end
async_tracker(&block) click to toggle source
# File lib/asynchro/extensions.rb, line 2
def async_tracker(&block)
  Asynchro::Tracker.new(&block)
end
yield_to() { |lambda| ... } click to toggle source
# File lib/asynchro/extensions.rb, line 10
def yield_to
  this = Fiber.current
  
  fiber = Fiber.new do
    yield(lambda { fiber.transfer(this) })
  end

  fiber.transfer(fiber)
end