mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-14 23:06:06 -05:00
12 lines
361 B
OCaml
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 }
|
|
|