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