package octez-internal-libs

  1. Overview
  2. Docs
A package that contains some libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65

doc/octez-internal-libs.irmin/Irmin/Backend/Watch/Make/index.html

Module Watch.MakeSource

Make builds an implementation of watch helpers.

Parameters

module K : Type.S
module V : Type.S

Signature

Watch Helpers

Sourcetype key = K.t

The type for store keys.

Sourcetype value = V.t

The type for store values.

Sourcetype watch

The type for watch handlers.

Sourcetype t

The type for watch state.

Sourceval 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.

Sourceval notify : t -> key -> value option -> unit Lwt.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.

Sourceval v : unit -> t

Create a watch state.

Sourceval clear : t -> unit Lwt.t

Clear all register listeners in the given watch state.

Sourceval watch_key : t -> key -> ?init:value -> (value Diff.t -> unit Lwt.t) -> watch Lwt.t

Watch a given key for changes. More efficient than watch.

Sourceval watch : t -> ?init:(key * value) list -> (key -> value Diff.t -> unit Lwt.t) -> watch Lwt.t

Add a watch handler. To watch a specific key, use watch_key which is more efficient.

Sourceval unwatch : t -> watch -> unit Lwt.t

Remove a watch handler.

Sourceval listen_dir : t -> string -> key:(string -> key option) -> value:(key -> value option Lwt.t) -> (unit -> unit Lwt.t) Lwt.t

Register a thread looking for changes in the given directory and return a function to stop watching and free up resources.

OCaml

Innovation. Community. Security.