package datakit-server

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

The type of typed streams.

type 'a session

The type for stream sessions.

val session : 'a -> 'a session

session init creates a fresh session, whose initial value is init.

val publish : 'a session -> 'a -> unit

publish s v publishes v in the session s.

val create : 'a Fmt.t -> 'a session -> t

create pp session is a fresh file stream. Readers of the stream will first get an initial line, printed with pp, corresponding to the current session's value. Everytime the session's state is changing, a new line -- formatted with pp -- is broadcasted to all the current readers of the stream.