Module Mavryk_rpc_http_server.RPC_server

Typed RPC services: server implementation.

type cors = {
  1. allowed_headers : string list;
  2. allowed_origins : string list;
}
module RPC_logging : Resto_cohttp_server.Server.LOGGING
include sig ... end
module Media_type : sig ... end
module Directory : sig ... end
type server = Resto_cohttp_server__Server.Make(Mavryk_rpc.Encoding)(RPC_logging).server
type callback = Cohttp_lwt_unix.Server.conn -> Cohttp.Request.t -> Cohttp_lwt.Body.t -> Cohttp_lwt_unix.Server.response_action Lwt.t
val init_server : ?cors:Resto_cohttp.Cors.t -> ?agent:string -> ?acl:Resto_acl.Acl.t -> media_types:Media_type.t list -> unit Directory.t -> server
val resto_callback : server -> callback
val init_and_launch : ?host:string -> ?cors:Resto_cohttp.Cors.t -> ?agent:string -> ?acl:Resto_acl.Acl.t -> media_types:Media_type.t list -> unit Directory.t -> Conduit_lwt_unix.server -> unit Lwt.t
val set_acl : server -> Resto_acl.Acl.t -> unit
val shutdown : server -> unit Lwt.t
module Max_active_rpc_connections : sig ... end

Limits (or not) the number of maximum allowed RPC connections at any given time

val launch : ?host:string -> server -> ?conn_closed:(Cohttp_lwt_unix.Server.conn -> unit) -> ?callback:callback -> ?max_active_connections:Max_active_rpc_connections.t -> Conduit_lwt_unix.server -> unit Lwt.t

launch ?host server ?conn_closed ?callback ?max_active_connections listening_protocol starts the given resto server initiating the listening loop using the

  • parameter [callback]

    overwrites (if given) the default handler of each resto http query will be treated by.

  • parameter [conn_closed]

    is an optional function that is called when a connection is closed.

  • parameter [max_active_connections]

    limits the number of active connections. When this limit is reached, the server will not process new requests until existing ones are completed. Defaults to 100.

module Acl : sig ... end