# Class e.p.h.h.ElisaHttpClientFactory(ClientFactory, Loggable):

Part of elisa.plugins.http_client.http_client View In Hierarchy

A specialized HTTP client factory that automatically reconnects when disconnected from the server if the client has pending requests (with a maximum of 3 retries in case of failure).

Line # | Kind | Name | Docs
--- | --- | --- | ---
67 | Method | __init__ | Undocumented
71 | Method | buildProtocol | Build and return the HTTP client protocol.
96 | Method | startedConnecting | Callback invoked when the connection is initiated.
105 | Method | clientConnectionFailed | Callback invoked when the connection fails.
117 | Method | clientConnectionLost | Callback invoked when the connection is lost.

def __init__(self, client):
overrides elisa.core.log.Loggable.__init__
Undocumented
def buildProtocol(self, addr):
Build and return the HTTP client protocol.

Parameters | addr | HTTP host and port (type: an implementation of `twisted.internet.interfaces.IAddress` )
Returns | an HTTP protocol instance (type: `ElisaHttpClientProtocol` )

def startedConnecting(self, connector):
Callback invoked when the connection is initiated.

Parameters | connector | the TCP connector (type: `twisted.internet.tcp.Connector` )

def clientConnectionFailed(self, connector, reason):
Callback invoked when the connection fails.

Parameters | connector | the TCP connector (type: `twisted.internet.tcp.Connector` )
| reason | the reason of the connection failure (type: `twisted.python.failure.Failure` )

def clientConnectionLost(self, connector, reason):
Callback invoked when the connection is lost. This happens when the server decides to terminate the connection.

Parameters | connector | the TCP connector (type: `twisted.internet.tcp.Connector` )
| reason | the reason of the connection loss (type: `twisted.python.failure.Failure` )