http-client-0.1.0.0: An HTTP client engine, intended as a base layer for more user-friendly packages.

Safe HaskellNone

Network.HTTP.Client.Manager

Synopsis

Documentation

data Manager Source

Keeps track of open connections for keep-alive. If possible, you should share a single Manager between multiple threads and requests.

mWrapIOException :: Manager -> forall a. IO a -> IO aSource

data ManagerSettings Source

Settings for a Manager. Please use the defaultManagerSettings function and then modify individual settings.

Constructors

ManagerSettings 

Fields

managerConnCount :: !Int

Number of connections to a single host to keep alive. Default: 10.

managerRawConnection :: !(IO (Maybe HostAddress -> String -> Int -> IO Connection))

Create an insecure connection.

managerTlsConnection :: !(IO (Maybe HostAddress -> String -> Int -> IO Connection))

Create a TLS connection. Default behavior: throw an exception that TLS is not supported.

managerResponseTimeout :: !(Maybe Int)

Default timeout (in microseconds) to be applied to requests which do not provide a timeout value.

Default is 5 seconds

Since 1.9.3

managerRetryableException :: !(SomeException -> Bool)

Exceptions for which we should retry our request if we were reusing an already open connection. In the case of IOExceptions, for example, we assume that the connection was closed on the server and therefore open a new one.

managerWrapIOException :: !(forall a. IO a -> IO a)
 

data ConnKey Source

ConnKey consists of a hostname, a port and a Bool specifying whether to use SSL.

Constructors

ConnKey !ConnHost !Int !Bool 

data ConnHost Source

Hostname or resolved host address.

Constructors

HostName !Text 
HostAddress !HostAddress 

newManager :: ManagerSettings -> IO ManagerSource

Create a Manager. You must manually call closeManager to shut it down.

Creating a new Manager is an expensive operation, you are advised to share a single Manager between requests instead.

closeManager :: Manager -> IO ()Source

Close all connections in a Manager. Afterwards, the Manager can be reused if desired.

Note that this doesn't affect currently in-flight connections, meaning you can safely use it without hurting any queries you may have concurrently running.

data ConnReuse Source

Constructors

Reuse 
DontReuse 

data ManagedConn Source

Constructors

Fresh 
Reused 

failedConnectionException :: Request -> HttpExceptionSource

Create an exception to be thrown if the connection for the given request fails.