core/fiber.rbs in rbs-3.3.2 vs core/fiber.rbs in rbs-3.4.0.pre.1

- old
+ new

@@ -369,10 +369,31 @@ # alias inspect to_s # <!-- # rdoc-file=cont.c + # - fiber.kill -> nil + # --> + # Terminates the fiber by raising an uncatchable exception. It only terminates + # the given fiber and no other fiber, returning `nil` to another fiber if that + # fiber was calling #resume or #transfer. + # + # `Fiber#kill` only interrupts another fiber when it is in Fiber.yield. If + # called on the current fiber then it raises that exception at the `Fiber#kill` + # call site. + # + # If the fiber has not been started, transition directly to the terminated + # state. + # + # If the fiber is already terminated, does nothing. + # + # Raises FiberError if called on a fiber belonging to another thread. + # + def kill: () -> nil + + # <!-- + # rdoc-file=cont.c # - fiber.raise -> obj # - fiber.raise(string) -> obj # - fiber.raise(exception [, string [, array]]) -> obj # --> # Raises an exception in the fiber at the point at which the last `Fiber.yield` @@ -386,9 +407,11 @@ # parameter should be the name of an `Exception` class (or an object that # returns an `Exception` object when sent an `exception` message). The optional # second parameter sets the message associated with the exception, and the third # parameter is an array of callback information. Exceptions are caught by the # `rescue` clause of `begin...end` blocks. + # + # Raises `FiberError` if called on a Fiber belonging to another `Thread`. # def raise: (?string msg) -> untyped | (_Exception, ?string msg, ?Array[string] backtrace) -> untyped # <!--