Module Luv__Signal
Signals.
See Signals in the user guide and uv_signal_t
— Signal handle in libuv.
Interface
type t
= [ `Signal ] Luv.Handle.t
Binds
uv_signal_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 -> unit -> (t, Luv.Error.t) Result.result
Allocates and initializes a signal handle.
Binds
uv_signal_init
.
val start : t -> int -> (unit -> unit) -> (unit, Luv.Error.t) Result.result
Starts the signal handle.
Binds
uv_signal_start
.See Signal numbers below for possible values of the integer argument.
val start_oneshot : t -> int -> (unit -> unit) -> (unit, Luv.Error.t) Result.result
Like
Luv.Signal.start
, but the handle is stopped after one callback call.Binds
uv_signal_start_oneshot
.Requires libuv 1.12.0.
Feature check:
Luv.Require.(has signal_start_oneshot)
val stop : t -> (unit, Luv.Error.t) Result.result
Stops the signal handle.
Binds
uv_signal_stop
.
val signum : t -> int
Evaluates to the signal number associated with the handle.
Binds
uv_signal_t.signum
.
Signal numbers
For the moment, the signals exposed are those that are both present on Unix and present or emulated by libuv on Windows. See Windows notes and Unix notes.
Note that these signal numbers do not, in general, match the ones in module Sys
in the OCaml standard library.