package stog_server
Module Stog_server.WsSource
Handling websocket connections in preview server
Source
val send_errors :
('a * (Websocket.Frame.t -> unit Lwt.t)) list ref ->
errors:string list ->
warnings:string list ->
unit Lwt.tSend errors and warnings to a list of client connections.
Source
val send_patch :
('a * (Websocket.Frame.t -> unit Lwt.t)) list ref ->
Stog.Types.stog ->
Stog.Types.stog ->
Stog.Types.doc Stog.Tmap.key ->
unit Lwt.tsend_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.
Source
val handle_messages :
(unit -> Stog.Types.stog) ->
Run.state option ref ->
('a * (Websocket.Frame.t -> unit Lwt.t)) list ref ->
string list ->
Websocket.Frame.t Lwt_stream.t ->
(Websocket.Frame.t -> unit Lwt.t) ->
unit Lwt.thandle_messages read_stog current_state active_cons base_path stream push handle client messages on websocket (stream, push).
Source
val run_server :
(unit -> Stog.Types.stog) ->
Run.state option ref ->
(Websocket.Frame.t Lwt_stream.t * (Websocket.Frame.t -> unit Lwt.t)) list ref ->
Stog.Url.url_config ->
string list ->
unit Lwt.tread_stog current_state active_cons ws_url base_path creates a server for previewing the documents in the current state.