Library
Module
Module type
Parameter
Class
Class type
module type Command_S = sig ... end
module type Client_S = sig ... end
Version used to set the protocol version
module V1 : sig ... end
module V2 : sig ... end
val pick_client :
pid:int ->
IO.ic ->
IO.oc ->
string list ->
(client, [ `Msg of string ]) result IO.t
The RPC offers multiple versions of the API. pick_client ~pid in out versions
handles the interaction with the server to agree with a common version of the RPC to use. Trying successively each version of the provided list versions
until the server agrees, for this reason you might want to list newer versions before older versions. The given IO.ic
and IO.oc
values are referenced by the client
value and must be kept open until halt
is called.
val pid : client -> int
Tell the server to close the connection. No more commands can be sent using the same client
value.
val format :
?format_args:format_args ->
string ->
client ->
(string, [> `Msg of string ]) result IO.t
format_args
modifies the server's configuration temporarily, for the current request.
A basic interaction could be:
RPC.config [("profile", "ocamlformat")] client >>= fun () ->
RPC.format "let x = 4 in x" client >>= fun formatted ->
...
RPC.halt client >>= fun () ->
...