Module Luv__Prepare

Pre-I/O callback.

See uv_prepare_t — Prepare handle in libuv.

type t = [ `Prepare ] Luv.Handle.t

Binds uv_prepare_t.

Note that values of this type can be passed to functions in Luv.Handle, in addition to the functions in this module. In particular, see Luv.Handle.close.

val init : ?⁠loop:Luv.Loop.t -> unit -> (tLuv.Error.t) Result.result

Allocates and initializes a prepare handle.

Binds uv_prepare_init.

The handle should be cleaned up with Luv.Handle.close when no longer needed.

val start : t -> (unit -> unit) -> (unit, Luv.Error.t) Result.result

Starts the handle with the given callback.

Binds uv_prepare_start.

val stop : t -> (unit, Luv.Error.t) Result.result

Stops the handle.

Binds uv_prepare_stop.