Change run_forever to use onDisconnect
This commit is contained in:
@@ -1582,8 +1582,7 @@ cdef class RpcServer:
|
||||
del self.thisptr
|
||||
|
||||
def run_forever(self):
|
||||
p = PromiseFulfillerPair()
|
||||
self.loop.wait(p)
|
||||
self.loop.wait(_VoidPromise()._init(deref(self.network.thisptr).onDisconnect()))
|
||||
|
||||
# TODO: add restore functionality here?
|
||||
|
||||
|
||||
@@ -204,6 +204,8 @@ cdef extern from "capnp/rpc-twoparty.h" namespace " ::capnp":
|
||||
SERVER" ::capnp::rpc::twoparty::Side::SERVER"
|
||||
cdef cppclass TwoPartyVatNetwork:
|
||||
TwoPartyVatNetwork(EventLoop &, AsyncIoStream& stream, Side)
|
||||
VoidPromise onDisconnect()
|
||||
VoidPromise onDrain()
|
||||
RpcSystem makeRpcServer(TwoPartyVatNetwork&, PyRestorer&, EventLoop&)
|
||||
RpcSystem makeRpcClient(TwoPartyVatNetwork&, EventLoop&)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user