Watch.Make
Make
builds an implementation of watch helpers.
module K : Type.S
module V : Type.S
val stats : t -> int * int
stats t
is a tuple (k,a)
represeting watch stats. k
is the number of single key watchers for the store t
and a
the number of global watchers for t
.
Notify all listeners in the given watch state that a key has changed, with the new value associated to this key. None
means the key has been removed.
val v : unit -> t
Create a watch state.
val clear : t -> unit Lwt.t
Clear all register listeners in the given watch state.
Watch a given key for changes. More efficient than watch
.
Add a watch handler. To watch a specific key, use watch_key
which is more efficient.