lib/polyphony/extensions/fiber.rb
# call-seq:
#   fiber.reset(value = nil) -> fiber
#   fiber.restart(value = nil) -> fiber
#
# Restarts the fiber, with the given value serving as the first value passed
# to the fiber's block.
#
# @param value [any] value passed to fiber block
# @return [Fiber] restarted fiber


Restarts the fiber, with the given value serving as the first value passed
to the fiber's block.
Restarts the fiber with the given value serving as the first value passed to the fiber ' s block .
def restart(value = nil)
      raise "Can't restart main fiber" if @main
      if @running
        schedule Polyphony::Restart.new(value)
        return self
      end
      fiber = parent.spin(@tag, @caller, &@block)
      @monitors&.each_key { |f| fiber.monitor(f) }
      fiber.schedule(value) unless value.nil?
      fiber
    end
def restart ( value = nil ) raise "Can't restart main fiber" if @main if @running schedule Polyphony :: Restart . new ( value ) return self end fiber = parent . spin ( @tag , @caller , & @block ) @monitors &. each_key { | f | fiber . monitor ( f ) } fiber . schedule ( value ) unless value . nil? fiber end
call-seq:
fiber.reset(value = nil) -> fiber
fiber.restart(value = nil) -> fiber
call - seq : fiber . reset ( value = nil ) - > fiber fiber . restart ( value = nil ) - > fiber
None
Fiber
value
value passed to fiber block
value passed to fiber block