class documentation

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): (source)

Start this ClientService, initiating the connection retry loop.

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

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: Optional[int] = None) -> Deferred[IProtocol]: (source)

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

Parameters
failAfterFailures:Optional[int]number 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: Optional[Failure] = None): (source)

The current connection has been disconnected.

def _connectionFailed(self, failure: Failure): (source)

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): (source)

A connection has been made.

Parameters
protocol:_ReconnectingProtocolProxyThe protocol of the connection.
def _reconnect(self, failure: Optional[Failure] = None): (source)

The wait between connection attempts is done.