Library
Module
Module type
Parameter
Class
Class type
Individual RPC procedures are versioned beyond the larger API version. At session startup, the server and client exchange version information for each method ("negotiation"), setting on a common version for each (if possible) to produce a "version menu".
To initiate a method, then, that method must be looked up in the version menu to determine the correct protocol for this session. This module stages this pattern to share the lookup for all calls to the same procedure.
For lower-level design details, see doc/dev/rpc-versioning.md
in the main dune repository.
val prepare_request :
t ->
('a, 'b) Dune_rpc.V1.Request.t ->
(('a, 'b) request, Dune_rpc.V1.Version_error.t) result Lwt.t
prepare_request client r
checks the request r
against the negotiated version menu, giving a versioned request as a result.
This function does not initiate any communication with the server. However, as this function must check the version menu, it cannot complete until after version negotiation, and so returns a fiber
.
val prepare_notification :
t ->
'a Dune_rpc.V1.Notification.t ->
('a notification, Dune_rpc.V1.Version_error.t) result Lwt.t
See prepare_request
.