Adding poll_once() to TwoPartyServer API
- poll_forever() doesn't allow for checking socket connection to client * Need to check for client, if eof received then we can close the connection and cleanup pycapnp cpu resources (async tasks) - Updated async examples to fix bugs * Add checking code for socket connection to the client and gracefully cleanup resources once the client socket connection closes * Instanciate a new TwoPartyServer per connection (allows for multiple connections) - Should resolve Issue #198
This commit is contained in:
@@ -2406,6 +2406,9 @@ cdef class TwoPartyServer:
|
||||
cpdef on_disconnect(self) except +reraise_kj_exception:
|
||||
return _VoidPromise()._init(deref(self._network.thisptr).onDisconnect())
|
||||
|
||||
def poll_once(self):
|
||||
return poll_once()
|
||||
|
||||
async def poll_forever(self):
|
||||
while True:
|
||||
poll_once()
|
||||
|
||||
Reference in New Issue
Block a user