Plasma GitLab Archive
Projects Blog Knowledge

Module Hydro_endpoint.Client


module Client: sig .. end


This module encapsulates the client interface
type t = [ `Client_role ] Hydro_endpoint.GeneralizedEndpoint.t 
A live client
val create : Hydro_types.system ->
Hydro_connector.client_connector ->
Unixqueue.event_system -> t
Create a new client
val configure : t -> Hydro_types.client_params -> unit
Configures the client. There is a default configuration for freshly created clients (XXX).
type response = < addr : Unix.sockaddr option; client : t option;
condition : [ `Client_is_down
| `Connect_error of exn
| `Connect_timeout
| `Error of exn
| `Facet_does_not_exist of
Hydro_types.identity * string option * string
| `Message_lost of bool
| `Message_timeout
| `Object_does_not_exist of
Hydro_types.identity * string option * string
| `Operation_does_not_exist of
Hydro_types.identity * string option * string
| `Success
| `Transport_timeout
| `Unknown_exception of string
| `Unknown_local_exception of string
| `Unknown_user_exception of string
| `User_exception of Hydro_types.sliced_value ];
mode : Hydro_types.op_mode; out_args : Hydro_types.value array;
peer : Unix.sockaddr option; result : Hydro_types.value >
A friendly version of response messages
val twoway_call : ?facet:string ->
t ->
Hydro_types.identity ->
Hydro_types.hintf ->
string ->
Hydro_types.call_params ->
Hydro_types.value array -> (response -> unit) -> unit
Starts a twoway call
val queued_requests : t -> int
Number of requests in the queue (that are not yet responded)
val is_up : t -> bool
Whether the client is up (accepts new requests)
val is_idle : t -> bool
Whether the client is up and idle
val client_id : t -> int
Returns an identifier for the client
val shutdown : ?ondown:(unit -> unit) -> t -> unit
Shut the client gracefully down (by sending a close connection message). This is an asynchronous shutdown. When it is done, the function ondown will be called.
val shutdown_when_idle : t -> unit
Shutdown gracefully the next time the client becomes idle
val abort : t -> unit
Closes the connection immediately (no close connection message).
val graceful : t -> bool
The graceful flag is initially true, but set to false when a fatal error or a non-graceful shutdown happens
val pool_connect : t -> (unit -> unit) -> unit
Used by Hydro_proxy.pool: The callback function is invoked when is_up becomes false
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml