class documentation

class _Client(TypingProtocol):

View In Hierarchy

Undocumented

Method start Start this ClientService, initiating the connection retry loop.
Method stop Stop trying to connect and disconnect any current connection.
Method whenConnected Retrieve the currently-connected Protocol, or the next one to connect.
Method _clientDisconnected The current connection has been disconnected.
Method _connectionFailed Deliver connection failures to any ClientService.whenConnected Deferreds that have met their failAfterFailures threshold.
Method _connectionMade A connection has been made.
Method _reconnect The wait between connection attempts is done.
def start(self):

Start this ClientService, initiating the connection retry loop.

def stop(self) -> Deferred[None]:

Stop trying to connect and disconnect any current connection.

Returns
Deferred[None]a Deferred that fires when all outstanding connections are closed and all in-progress connection attempts halted.
def whenConnected(self, /, failAfterFailures: int | None = None) -> Deferred[IProtocol]:

Retrieve the currently-connected Protocol, or the next one to connect.

Parameters
failAfterFailures:int | Nonenumber of connection failures after which the Deferred will deliver a Failure (None means the Deferred will only fail if/when the service is stopped). Set this to 1 to make the very first connection failure signal an error. Use 2 to allow one failure but signal an error if the subsequent retry then fails.
Returns
Deferred[IProtocol]

a Deferred that fires with a protocol produced by the factory passed to __init__. It may:

def _clientDisconnected(self, failure: Failure | None = None):

The current connection has been disconnected.

def _connectionFailed(self, failure: Failure):

Deliver connection failures to any ClientService.whenConnected Deferreds that have met their failAfterFailures threshold.

Parameters
failure:Failurethe Failure to fire the Deferreds with.
def _connectionMade(self, protocol: _ReconnectingProtocolProxy):

A connection has been made.

Parameters
protocol:_ReconnectingProtocolProxyThe protocol of the connection.
def _reconnect(self, failure: Failure | None = None):

The wait between connection attempts is done.