Module Luv__Async
Inter-loop communication.
See Inter-thread communication in the user guide and uv_async_t
— Async handle in libuv.
type t
= [ `Async ] Luv.Handle.t
Binds
uv_async_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, seeLuv.Handle.close
.
val init : ?loop:Luv.Loop.t -> (t -> unit) -> (t, Luv.Error.t) Result.result
Allocates and initializes an async handle.
Binds
uv_async_init
.The handle should be cleaned up with
Luv.Handle.close
when no longer needed.
val send : t -> (unit, Luv.Error.t) Result.result
Triggers a call to the handle's callback by the handle's loop.
Binds
uv_async_send
.