boots-cloud-0.2: Factory for quickly building a microservice

Copyright2019 Daniel YU
LicenseMIT
Maintainerleptonyu@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Boots.Cloud

Contents

Description

A quick out-of-box factory using to build microservices with many useful builtin components based on boots-web.

Synopsis

Service management

buildConsul :: (MonadMask n, MonadIO n, HasSalak env, HasApp env, HasLogger env) => Factory n (WebEnv env context) () Source #

Register consule service.

Client

data ManagerSettings #

Settings for a Manager. Please use the defaultManagerSettings function and then modify individual settings. For more information, see http://www.yesodweb.com/book/settings-types.

Since 0.1.0

Instances
Default ManagerSettings Source # 
Instance details

Defined in Boots.Factory.Client

FromProp m ManagerSettings Source # 
Instance details

Defined in Boots.Factory.Client

data Manager #

Keeps track of open connections for keep-alive.

If possible, you should share a single Manager between multiple threads and requests.

Since 0.1.0

Instances
HasHttpManager Manager 
Instance details

Defined in Network.HTTP.Client.Types

newManager :: ManagerSettings -> IO Manager #

Create a Manager. The Manager will be shut down automatically via garbage collection.

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

The first argument to this function is often defaultManagerSettings, though add-on libraries may provide a recommended replacement.

Since 0.1.0

managerConnCount :: ManagerSettings -> Int #

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

Since 0.1.0

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

Create an insecure connection.

Since 0.1.0

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

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

Since 0.1.0

managerResponseTimeout :: ManagerSettings -> ResponseTimeout #

Default timeout to be applied to requests which do not provide a timeout value.

Default is 30 seconds

Since: http-client-0.5.0

managerRetryableException :: ManagerSettings -> 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.

Since 0.1.0

managerWrapException :: ManagerSettings -> forall a. Request -> IO a -> IO a #

Action wrapped around all attempted Requests, usually used to wrap up exceptions in library-specific types.

Default: wrap all IOExceptions in the InternalException constructor.

Since: http-client-0.5.0

managerIdleConnectionCount :: ManagerSettings -> Int #

Total number of idle connection to keep open at a given time.

This limit helps deal with the case where you are making a large number of connections to different hosts. Without this limit, you could run out of file descriptors. Additionally, it can be set to zero to prevent reuse of any connections. Doing this is useful when the server your application is talking to sits behind a load balancer.

Default: 512

Since 0.3.7

managerModifyRequest :: ManagerSettings -> Request -> IO Request #

Perform the given modification to a Request before performing it.

Default: no modification

Since 0.4.4

managerModifyResponse :: ManagerSettings -> Response BodyReader -> IO (Response BodyReader) #

Perform the given modification to a Response after receiving it.

Default: no modification

Since: http-client-0.5.5