package streamable

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type ('state_part, 'update_part) direct_writer := ('state_part, 'update_part) t
type ('state_part, 'update_part) t
val create : ?buffer:Async_rpc_kernel.Rpc.Pipe_rpc.Direct_stream_writer.Group.Buffer.t -> ?send_last_value_on_add:bool -> unit -> (_, _) t
val flushed_or_closed : (_, _) t -> unit Async_kernel.Deferred.t

flushed_or_closed t is determined when the underlying writer for each member of t is flushed or closed.

val add_exn : ('state_part, 'update_part) t -> ('state_part, 'update_part) direct_writer -> unit

Add a direct writer to the group. Raises if the writer has not finalised its initial state, if the writer is closed or already part of the group, or if its bin-prot writer is different than an existing group member's. When the writer is closed, it is automatically removed from the group.

val remove : ('state_part, 'update_part) t -> ('state_part, 'update_part) direct_writer -> unit

Remove a writer from a group. Note that writers are automatically removed from all groups when they are closed, so you only need to call this if you want to remove a writer without closing it.

val write_update_without_pushback : (_, 'update_part) t -> 'update_part -> unit

Write an update part on all direct writers in the group. Contrary to Direct_writer.write_without_pushback, this cannot return `Closed as elements of the group are removed immediately when they are closed, and it cannot raise due to initial state not being finalised as this is checked when adding to the group.

val finalise_update_without_pushback : (_, _) t -> unit

Finalise the current update on all direct writers in the group.

val length : (_, _) t -> int

The number of clients currently.

val close_all : ('state_part, 'update_part) t -> unit

Close all of the added clients.

You can use flushed_or_closed to then wait for the closing to complete.

OCaml

Innovation. Community. Security.