moonpool/src/lwt/cancel_handle.ml
2024-02-17 12:40:35 -05:00

12 lines
361 B
OCaml

(** Cancellation handle. *)
type t = { cancel: unit -> unit } [@@unboxed]
(** A handle to cancel atomic actions (waiting on something), or
stopping a subscription to some event. *)
(** Perform the cancellation. This should be idempotent. *)
let[@inline] cancel self = self.cancel ()
(** Dummy that cancels nothing *)
let dummy : t = { cancel = ignore }