package fiber
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Module Fiber.CancelSource
Fiber cancellation
This module provides a way to cancel long running computations. Cancellation is fully explicit and fibers must explicitely check for it at strategic points.
Activate a cancellation request.
fire is idempotent, so calling fire t more than once has no effect.
Version of fire that is suitable to call from the iter callback of Fiber.run.
Source
val with_handler :
t ->
(unit -> 'a fiber) ->
on_cancel:(unit -> 'b fiber) ->
('a * 'b outcome) fiberwith_handler t ~on_cancel f runs f () with a cancellation handler. If t is fired during the execution of f, then on_cancel is called.
The aim of on_cancel is to somehow cut short the execution of f. A typical example is a function running an external command. on_cancel might send a KILL signal to the command to abort its execution.
If f () finished before t is fired, then on_cancel will never be invoked.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page