class type sync_client = object
.. end
Client access to cache by synchronous RPC calls
method client_config : client_config
The configuration of this client
method set : key ->
string ->
int64 -> set_options -> [ `Not_stored | `Stored | `Timeout ]
set r k v t_exp opts
: Tries to set key k
to value v
with
expiration timestamp t_opt
. The options opts
determine which
kind of set operation is allowed. The result can be `Stored
meaning a successful modification, `Not_stored
meaning the
refusal of a modification, or `Timeout
meaning a timeout
contacting the server.
method get : key ->
get_options ->
[ `Found of entry | `Not_found | `Timeout ]
get r k opts
: Tries to get the entry for key k
. The options
opts
determine which entries can be retrieved in this way.
The result can be `Found e
with the entry e
, `Not_found
if the key cannot be located or the options prevent the entry
from being returned, or `Timeout
if the server is not reachable.
method delete : key ->
int64 -> delete_options -> [ `Ok | `Timeout ]
delete r k t_del opts
: Tries to move the entry for key k
from
the regular store to the delete queue where it is marked as being
scheduled for deletion at time t_del
. If t_del
is in the past,
the deletion is conducted immediately. If the entry does not
qualify for deletion because of a failed requirement in opts
,
it is silently not moved to the delete queue, without telling the
caller. The result is `Ok
meaning the server could be contacted,
or `Timeout
meaning a timeout happened.
method clear : unit -> [ `Ok | `Timeout ]
clear r
: Delete all entries. The result is `Ok
meaning the
deletion was successful, or `Timeout
meaning a timeout happened.
method get_config : unit ->
[ `Ok of (Rpc_client.connector * config) list | `Timeout ]
get_config r
: Return the connector and the server config for
all servers as list l
. The connector may serve as identifier
for the server. The result is `Ok l
meaning the
config of all servers could be retrieved, or `Timeout
meaning a
timeout happened for at least one server.
method set_config : (Rpc_client.connector * config) list -> [ `Ok | `Timeout ]
set_config r
: Set the server config for the servers identified
by connectors in list l
. The result is `Ok l
meaning the
config of all named servers could be set, or `Timeout
meaning a
timeout happened for at least one server.
method get_stats : unit ->
[ `Ok of (Rpc_client.connector * stats) list | `Timeout ]
get_stats r
: Return the connector and the statistics record for
all servers as list l
. The connector may serve as identifier
for the server. The result is `Ok l
meaning the
config of all servers could be retrieved, or `Timeout
meaning a
timeout happened for at least one server.
method clear_counters : unit -> [ `Ok | `Timeout ]
clear_counters r
: Reset the statistics counters for all servers.
The result is `Ok
meaning the counters could be reset on all
servers, or `Timeout
meaning a timeout happened for at least one
server.
method shutdown : unit -> unit
Shutdown all network connections. If further RPC calls are requested,
new network connections are opened.