moonpool/src/unix/cancel_handle.mli
2024-02-08 20:39:35 -05:00

12 lines
323 B
OCaml

type t
(** A handle to cancel atomic actions (waiting on something), or
stopping a subscription to some event. *)
val create : unit -> t
val create_with : (unit -> unit) -> t
val on_cancel : t -> (unit -> unit) -> unit
val cancel : t -> unit
(** Perform the cancellation. This should be idempotent. *)
val dummy : t