Loading sjrpc/core/protocols/tunnel.py +13 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,19 @@ class TunnelProtocol(Protocol): self._cb_on_shutdown(self) super(TunnelProtocol, self).shutdown() def wait_shutdown(self, timeout=None, sig_timeout=1): """ Wait until tunnel has been shutdown. Return True if shutdown has been triggered, or False if timeout occurs. """ if timeout is None: # Workaround to avoid signal to be masked by Python # while waiting the event. while True: if self._is_shutdown.wait(sig_timeout): return True else: return self._is_shutdown.wait(timeout) def end_of_message(self): """ Handle inbound data from the :class:`RpcConnection` peer and place it on the incoming buffer. Loading Loading
sjrpc/core/protocols/tunnel.py +13 −0 Original line number Diff line number Diff line Loading @@ -146,6 +146,19 @@ class TunnelProtocol(Protocol): self._cb_on_shutdown(self) super(TunnelProtocol, self).shutdown() def wait_shutdown(self, timeout=None, sig_timeout=1): """ Wait until tunnel has been shutdown. Return True if shutdown has been triggered, or False if timeout occurs. """ if timeout is None: # Workaround to avoid signal to be masked by Python # while waiting the event. while True: if self._is_shutdown.wait(sig_timeout): return True else: return self._is_shutdown.wait(timeout) def end_of_message(self): """ Handle inbound data from the :class:`RpcConnection` peer and place it on the incoming buffer. Loading