Loading sjrpc/core/protocols/rpc.py +8 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ class RpcProtocol(Protocol): :param connection: the connection serving this :class:`RpcProtocol` :param label: the label of this :class:`RpcProtocol` instance :param handler: command handler to bind by default :param on_disconnect: callback called when client disconnect :param on_disconnect: callback called when client disconnect, could be the name of an RPC handler or a callable :param timeout: global command timeout ''' Loading Loading @@ -283,8 +284,11 @@ class RpcProtocol(Protocol): self._handle_response({'id': cid, 'return': None, 'error': err}) # Execute on_disconnect callback: if self._on_disconnect is None: return callback = None if self._on_disconnect is not None and not callable(self._on_disconnect): if not callable(self._on_disconnect): if self._handler is not None: try: callback = self._handler[self._on_disconnect] Loading @@ -296,6 +300,8 @@ class RpcProtocol(Protocol): self.logger.warn('Shutdown callback specified but no handler ' 'binded on rpc, ignoring') callback = None else: callback = self._on_disconnect if callback is not None: try: Loading Loading
sjrpc/core/protocols/rpc.py +8 −2 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ class RpcProtocol(Protocol): :param connection: the connection serving this :class:`RpcProtocol` :param label: the label of this :class:`RpcProtocol` instance :param handler: command handler to bind by default :param on_disconnect: callback called when client disconnect :param on_disconnect: callback called when client disconnect, could be the name of an RPC handler or a callable :param timeout: global command timeout ''' Loading Loading @@ -283,8 +284,11 @@ class RpcProtocol(Protocol): self._handle_response({'id': cid, 'return': None, 'error': err}) # Execute on_disconnect callback: if self._on_disconnect is None: return callback = None if self._on_disconnect is not None and not callable(self._on_disconnect): if not callable(self._on_disconnect): if self._handler is not None: try: callback = self._handler[self._on_disconnect] Loading @@ -296,6 +300,8 @@ class RpcProtocol(Protocol): self.logger.warn('Shutdown callback specified but no handler ' 'binded on rpc, ignoring') callback = None else: callback = self._on_disconnect if callback is not None: try: Loading