lib/polyphony/extensions/fiber.rb
# Finalizes the fiber, handling its return value or any uncaught exception.
#
# @param result [any] return value
# @param uncaught_exception [Exception, nil] uncaught exception
# @return [void]
Finalizes the fiber, handling its return value or any uncaught exception.
Finalizes the fiber handling its return value or any uncaught exception .
def finalize(result, uncaught_exception = false)
      result, uncaught_exception = finalize_children(result, uncaught_exception)
      Thread.backend.trace(:terminate, self, result)
      @result = result
      inform_monitors(result, uncaught_exception)
      @running = false
    ensure
      @parent&.remove_child(self)
      @thread.fiber_unschedule(self)
      Thread.current.switch_fiber
    end
def finalize ( result , uncaught_exception = false ) result , uncaught_exception = finalize_children ( result , uncaught_exception ) Thread . backend . trace ( :terminate , self , result ) @result = result inform_monitors ( result , uncaught_exception ) @running = false ensure @parent &. remove_child ( self ) @thread . fiber_unschedule ( self ) Thread . current . switch_fiber end
Finalizes the fiber, handling its return value or any uncaught exception.
Finalizes the fiber handling its return value or any uncaught exception .
# Prevent fiber from being resumed after terminating
None
void
result
None
uncaught_exception
None