package stog_server

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

Handling websocket connections in preview server

val wait_forever : unit -> 'a Lwt.t

A never-ending function

val send_errors : ('a * (Websocket.Frame.t -> unit Lwt.t)) list Stdlib.ref -> errors:string list -> warnings:string list -> unit Lwt.t

Send errors and warnings to a list of client connections.

val send_patch : ('a * (Websocket.Frame.t -> unit Lwt.t)) list Stdlib.ref -> Stog.Types.stog -> Stog.Types.stog -> Stog.Types.doc Stog.Tmap.key -> unit Lwt.t

send_patchs active_cons old_stog stog doc_id sends, to the current list of client connections, a patch from the differences in the document doc_id between old_stog and stog.

val handle_messages : (unit -> Stog.Types.stog) -> Run.state option Stdlib.ref -> ('a * (Websocket.Frame.t -> unit Lwt.t)) list Stdlib.ref -> string list -> Websocket.Frame.t Lwt_stream.t -> (Websocket.Frame.t -> unit Lwt.t) -> unit Lwt.t

handle_messages read_stog current_state active_cons base_path stream push handle client messages on websocket (stream, push).

val run_server : (unit -> Stog.Types.stog) -> Run.state option Stdlib.ref -> (Websocket.Frame.t Lwt_stream.t * (Websocket.Frame.t -> unit Lwt.t)) list Stdlib.ref -> Stog.Url.url_config -> string list -> unit Lwt.t

read_stog current_state active_cons ws_url base_path creates a server for previewing the documents in the current state.

OCaml

Innovation. Community. Security.