lwt-watcher

One-to-many broadcast in Lwt
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library lwt-watcher
Module Lwt_watcher
type 'a input
val create_input : unit -> 'a input
val notify : 'a input -> 'a -> unit

notify t v publishes value v to the input t

type stopper
val create_stream : 'a input -> 'a Lwt_stream.t * stopper

create_stream t registers a new client which can read published values via a stream. A stopper is used to shutdown the client.

val create_fake_stream : unit -> 'a Lwt_stream.t * stopper

A fake stream never receives any value.

val shutdown : stopper -> unit

shutdown s unregisters the client associated to s. None is pushed to the stream.

val shutdown_input : 'a input -> unit

Shutdowns all the clients of this input