package capnp-rpc
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ef3f64b22d90bfe87f96e751bc61d29646c970032803c4135bec8626aecf704d
sha512=41731da19a0ec67ae8d519f70ba95bae143493df64133965e9dfd9eb7ca33c745efa6047f8784689be6230a2fefd77649b61635e9b713366e42fd8e89ee07512
doc/capnp-rpc.proto/Capnp_rpc_proto/CapTP/Make/index.html
Module CapTP.MakeSource
Parameters
module EP : Message_types.ENDPOINTSignature
A t is a connection to a remote vat.
A restorer is a function f for restoring saved capabilities. f k object_id must eventually call k result exactly once to respond to the client's bootstrap message with result. k takes ownership of the capability.
val create :
?restore:restorer ->
tags:Logs.Tag.set ->
fork:((unit -> unit) -> unit) ->
queue_send:([> EP.Out.t ] -> unit) ->
tcreate ~restore ~tags ~fork ~queue_send is a handler for a connection to a remote peer. Messages will be sent to the peer by calling queue_send (which MUST deliver them in order). If the remote peer asks for a bootstrap object, restore will be used to get it. Log messages will be tagged with tags.
bootstrap t object_id returns a reference to the remote peer's bootstrap object, if any. object_id is the "deprecatedObjectId", which is, however, still used. This call does not block; the result is a promise for the object, on which further messages may be pipelined.
handle_msg t feeds one message received from the remote peer into t. It will call queue_send as necessary to handle the call. Messages MUST be fed to handle_msg in the order in which they arrive from the peer.
disconnect t reason breaks all references with reason and releases the bootstrap object. Does nothing if already disconnected.
Debugging and diagnostics
tags t is a set of logging tags suitable for logging a message about this connection.