package async_extended

  1. Overview
  2. Docs

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.

type t

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

val create : release:(unit -> unit Async_kernel.Deferred.t) -> t
val release : t -> unit Async_kernel.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