Up

Module Handle

Handle is something you get when you acquire a resource and you use the handle to release the resource.

Handle lifetime corresponds to a particular resource activation.

Signature

type t

This type keeps a clean-up action, that has to be executed exactly once.

val create : release:(unit -> unit Async_kernel.Std.Deferred.t) -> t
val release : t -> unit Async_kernel.Std.Deferred.t

Runs the clean-up action unless it has already been started. The result becomes determined whenever the cleanup action completes.

val check : alert:(unit -> unit) -> t -> t