sig
module ReliabilityCache :
sig
type rcache
type rcache_policy =
[ `Any_failing_port_disables_host
| `Failing_port_disables_host of int
| `Independent
| `None ]
type rcache_config = {
rcache_policy : Rpc_proxy.ReliabilityCache.rcache_policy;
rcache_disable_timeout_min : float;
rcache_disable_timeout_max : float;
rcache_threshold : int;
rcache_availability :
Rpc_proxy.ReliabilityCache.rcache -> Unix.sockaddr -> bool;
}
val create_rcache_config :
?policy:Rpc_proxy.ReliabilityCache.rcache_policy ->
?disable_timeout_min:float ->
?disable_timeout_max:float ->
?threshold:int ->
?availability:(Rpc_proxy.ReliabilityCache.rcache ->
Unix.sockaddr -> bool) ->
unit -> Rpc_proxy.ReliabilityCache.rcache_config
val create_rcache :
Rpc_proxy.ReliabilityCache.rcache_config ->
Rpc_proxy.ReliabilityCache.rcache
val rcache_config :
Rpc_proxy.ReliabilityCache.rcache ->
Rpc_proxy.ReliabilityCache.rcache_config
val global_rcache_config :
unit -> Rpc_proxy.ReliabilityCache.rcache_config
val set_global_rcache_config :
Rpc_proxy.ReliabilityCache.rcache_config -> unit
val global_rcache : unit -> Rpc_proxy.ReliabilityCache.rcache
val derive_rcache :
Rpc_proxy.ReliabilityCache.rcache ->
Rpc_proxy.ReliabilityCache.rcache_config ->
Rpc_proxy.ReliabilityCache.rcache
val incr_rcache_error_counter :
Rpc_proxy.ReliabilityCache.rcache -> Unix.sockaddr -> unit
val reset_rcache_error_counter :
Rpc_proxy.ReliabilityCache.rcache -> Unix.sockaddr -> unit
val sockaddr_is_enabled :
Rpc_proxy.ReliabilityCache.rcache -> Unix.sockaddr -> bool
val host_is_enabled :
Rpc_proxy.ReliabilityCache.rcache -> Unix.inet_addr -> bool
end
module ManagedClient :
sig
type mclient
type mclient_config = {
mclient_rcache : Rpc_proxy.ReliabilityCache.rcache;
mclient_socket_config : Rpc_client.socket_config;
mclient_idle_timeout : float;
mclient_programs : Rpc_program.t list;
mclient_msg_timeout : float;
mclient_msg_timeout_is_fatal : bool;
mclient_exception_handler : (exn -> unit) option;
mclient_auth_methods : Rpc_client.auth_method list;
mclient_user_name : string option;
mclient_initial_ping : bool;
mclient_max_response_length : int option;
mclient_mstring_factories :
Netxdr_mstring.named_mstring_factories option;
}
exception Service_unavailable
val create_mclient_config :
?rcache:Rpc_proxy.ReliabilityCache.rcache ->
?socket_config:Rpc_client.socket_config ->
?idle_timeout:float ->
?programs:Rpc_program.t list ->
?msg_timeout:float ->
?msg_timeout_is_fatal:bool ->
?exception_handler:(exn -> unit) ->
?auth_methods:Rpc_client.auth_method list ->
?user_name:string option ->
?initial_ping:bool ->
?max_response_length:int ->
?mstring_factories:Netxdr_mstring.named_mstring_factories ->
unit -> Rpc_proxy.ManagedClient.mclient_config
val create_mclient :
Rpc_proxy.ManagedClient.mclient_config ->
Rpc_client.connector ->
Unixqueue.event_system -> Rpc_proxy.ManagedClient.mclient
type state = [ `Connecting | `Down | `Up of Unix.sockaddr option ]
val mclient_state :
Rpc_proxy.ManagedClient.mclient -> Rpc_proxy.ManagedClient.state
val mclient_serial : Rpc_proxy.ManagedClient.mclient -> int
val pending_calls : Rpc_proxy.ManagedClient.mclient -> int
val event_system :
Rpc_proxy.ManagedClient.mclient -> Unixqueue.event_system
val shut_down : Rpc_proxy.ManagedClient.mclient -> unit
val sync_shutdown : Rpc_proxy.ManagedClient.mclient -> unit
val trigger_shutdown :
Rpc_proxy.ManagedClient.mclient -> (unit -> unit) -> unit
val record_unavailability : Rpc_proxy.ManagedClient.mclient -> unit
val enforce_unavailability : Rpc_proxy.ManagedClient.mclient -> unit
val set_batch_call : Rpc_proxy.ManagedClient.mclient -> unit
val rpc_engine :
Rpc_proxy.ManagedClient.mclient ->
(Rpc_proxy.ManagedClient.mclient ->
'a -> ((unit -> 'b) -> unit) -> unit) ->
'a -> 'b Uq_engines.engine
val compare :
Rpc_proxy.ManagedClient.mclient ->
Rpc_proxy.ManagedClient.mclient -> int
type t = mclient
val use : t -> Rpc_program.t -> unit
val unbound_sync_call :
t -> Rpc_program.t -> string -> Netxdr.xdr_value -> Netxdr.xdr_value
val unbound_async_call :
t ->
Rpc_program.t ->
string ->
Netxdr.xdr_value -> ((unit -> Netxdr.xdr_value) -> unit) -> unit
val xdr_ctx : t -> Netxdr.ctx
end
module ManagedSet :
sig
type mset
type mset_policy = [ `Balance_load | `Failover ]
type mset_config = {
mset_mclient_config : Rpc_proxy.ManagedClient.mclient_config;
mset_policy : Rpc_proxy.ManagedSet.mset_policy;
mset_pending_calls_max : int;
mset_pending_calls_norm : int;
mset_idempotent_max : int;
mset_idempotent_wait : float;
}
exception Cluster_service_unavailable
val create_mset_config :
?mclient_config:Rpc_proxy.ManagedClient.mclient_config ->
?policy:Rpc_proxy.ManagedSet.mset_policy ->
?pending_calls_max:int ->
?pending_calls_norm:int ->
?idempotent_max:int ->
?idempotent_wait:float -> unit -> Rpc_proxy.ManagedSet.mset_config
val create_mset :
Rpc_proxy.ManagedSet.mset_config ->
(Rpc_client.connector * int) array ->
Unixqueue.event_system -> Rpc_proxy.ManagedSet.mset
val mset_pick :
?from:int list ->
Rpc_proxy.ManagedSet.mset -> Rpc_proxy.ManagedClient.mclient * int
val mset_services :
Rpc_proxy.ManagedSet.mset -> (Rpc_client.connector * int) array
val mset_load : Rpc_proxy.ManagedSet.mset -> int array
val event_system : Rpc_proxy.ManagedSet.mset -> Unixqueue.event_system
val shut_down : Rpc_proxy.ManagedSet.mset -> unit
val sync_shutdown : Rpc_proxy.ManagedSet.mset -> unit
val trigger_shutdown :
Rpc_proxy.ManagedSet.mset -> (unit -> unit) -> unit
val idempotent_async_call :
?from:int list ->
Rpc_proxy.ManagedSet.mset ->
(Rpc_proxy.ManagedClient.mclient ->
'a -> ((unit -> 'b) -> unit) -> unit) ->
'a -> ((unit -> 'b) -> unit) -> unit
val idempotent_sync_call :
?from:int list ->
Rpc_proxy.ManagedSet.mset ->
(Rpc_proxy.ManagedClient.mclient ->
'a -> ((unit -> 'b) -> unit) -> unit) ->
'a -> 'b
end
end