def clientConnected(self, protocol): self._protocol = protocol if IPersistentClientProtocol.providedBy(protocol): prd = protocol.notifyProtocolReady() prd.addCallback( lambda _: self.clientProtocolReady(protocol)).addErrback( self.clientProtocolFailed) else: self.clientProtocolReady(protocol)
def clientConnected(self, protocol): self._protocol = protocol if IPersistentClientProtocol.providedBy(protocol): prd = protocol.notifyProtocolReady() prd.addCallback( lambda _: self.clientProtocolReady(protocol) ).addErrback( self.clientProtocolFailed ) else: self.clientProtocolReady(protocol)
def clientConnected(self, protocol): # protocol may be used to abort connection in `stopService` self._protocol = protocol self._protocol_ready = False if IPersistentClientProtocol.providedBy(protocol): prd = protocol.notifyProtocolReady() prd.addCallback( lambda _: self.clientProtocolReady(protocol)).addErrback( self.clientProtocolFailed) else: self.clientProtocolReady(protocol)
def clientConnected(self, protocol): # protocol may be used to abort connection in `stopService` self._protocol = protocol self._protocol_ready = False if IPersistentClientProtocol.providedBy(protocol): prd = protocol.notifyProtocolReady() prd.addCallback( lambda _: self.clientProtocolReady(protocol) ).addErrback( self.clientProtocolFailed ) else: self.clientProtocolReady(protocol)