master: helper functions to force disconnect everything

This commit is contained in:
David Wilson 2018-02-15 00:45:09 +05:45
parent 4a431a1a85
commit bb662a1a0b
1 changed files with 7 additions and 0 deletions

View File

@ -615,6 +615,13 @@ class Router(mitogen.parent.Router):
child = parent
parent = parent.via
def disconnect_stream(self, stream):
self.broker.defer(stream.on_disconnect, self.broker)
def disconnect_all(self):
for stream in self._stream_by_id.values():
self.disconnect_stream(stream)
class IdAllocator(object):
def __init__(self, router):