Module Luv__.FS_poll

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

Binds uv_fs_poll_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 an FS polling handle.

Binds uv_fs_poll_init.

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

val start : ?⁠interval:int -> t -> string -> ((Luv.File.Stat.t * Luv.File.Stat.tLuv.Error.t) Result.result -> unit) -> unit

Starts the handle and polls the given path for changes.

Binds uv_fs_poll_start.

The default value of ?interval is 2000 (milliseconds).

See uv_fs_poll_cb for a description of the values passed to the callback.

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

Stops the handle.

Binds uv_fs_poll_stop.