def subscribe(self, method, params, *args, **kwargs): ''' This is like standard RPC call, except that parameters are stored into after_connect list, so the same command will perform again on restored connection. ''' if not self.client: raise custom_exceptions.TransportException("Not connected") self.after_connect.append((method, params)) return self.client.rpc(method, params, worker, *args, **kwargs)
def connection_timeout(self): self.timeout_handler = None if self.client: return e = custom_exceptions.TransportException( "SocketTransportClientFactory connection timed out") if not self.on_connect.called: d = self.on_connect self.on_connect = defer.Deferred() d.errback(e) else: raise e
def rpc(self, method, params, worker, *args, **kwargs): if not self.client: raise custom_exceptions.TransportException("Not connected") return self.client.rpc(method, params, worker, *args, **kwargs)