package irmin-watcher

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Watchdog functions. Ensure that only one background process is monitoring events for a given directory.

type t

The type for filesystem watchdogs.

val dispatch : t -> Dispatch.t

dispath t is the table of t's callback dispatch.

type hook = (string -> unit Lwt.t) -> (unit -> unit Lwt.t) Lwt.t

The type for watchdog hook.

val empty : unit -> t

empty () is the empty watchdog, monitoring no directory.

val clear : t -> unit Lwt.t

clear () stops all the currently active watchdogs.

val start : t -> dir:string -> hook -> unit Lwt.t

start t ~dir h adds a new callback hook on the directory dir, starting a new watchdog if needed otherwise re-using the previous one.

val stop : t -> dir:string -> unit Lwt.t

stop t ~dir stops the filesystem watchdog on directory dir (if any).

val length : t -> int

length t is the number of watchdog threads.

OCaml

Innovation. Community. Security.