Function tarantool::fiber::cancel

source ·
pub fn cancel(id: FiberId) -> bool
Expand description

Cancel the fiber with the given id.

Does NOT yield.

Returns false if the fiber was not found.

Returns true if the fiber was found and has been marked for cancelation.

NOTE: If the current tarantool executable doesn’t support the required api (i.e. has_fiber_id returns false) this will use an inefficient implementation base on the lua api.

NOTE: tarantool does not guarantee that the cancelled fiber stops executing. It’s the responsibility of the fiber’s author to check if it was cancelled by checking is_cancelled or similar after any yielding calls and explicitly returning.