Add bootstrap RPC methods
This is the new way for initializing RPC connections. It replaces the deprecated restore functionality
This commit is contained in:
@@ -30,6 +30,7 @@ cdef extern from "capnp/helpers/rpcHelper.h":
|
||||
Capability.Client restoreHelper(RpcSystem&, MessageReader&)
|
||||
Capability.Client restoreHelper(RpcSystem&, AnyPointer.Reader&)
|
||||
Capability.Client restoreHelper(RpcSystem&, AnyPointer.Builder&)
|
||||
Capability.Client bootstrapHelper(RpcSystem&)
|
||||
RpcSystem makeRpcClientWithRestorer(TwoPartyVatNetwork&, PyRestorer&)
|
||||
PyPromise connectServer(TaskSet &, PyRestorer &, AsyncIoContext *, StringPtr)
|
||||
|
||||
|
||||
@@ -73,6 +73,13 @@ capnp::Capability::Client restoreHelper(capnp::RpcSystem<capnp::rpc::twoparty::S
|
||||
return client.restore(hostId, objectId);
|
||||
}
|
||||
|
||||
capnp::Capability::Client bootstrapHelper(capnp::RpcSystem<capnp::rpc::twoparty::SturdyRefHostId>& client) {
|
||||
capnp::MallocMessageBuilder hostIdMessage(8);
|
||||
auto hostId = hostIdMessage.initRoot<capnp::rpc::twoparty::SturdyRefHostId>();
|
||||
hostId.setSide(capnp::rpc::twoparty::Side::SERVER);
|
||||
return client.bootstrap(hostId);
|
||||
}
|
||||
|
||||
template <typename SturdyRefHostId, typename ProvisionId,
|
||||
typename RecipientId, typename ThirdPartyCapId, typename JoinAnswer>
|
||||
capnp::RpcSystem<SturdyRefHostId> makeRpcClientWithRestorer(
|
||||
|
||||
Reference in New Issue
Block a user