connection-pool-0.2: Connection pool built on top of resource-pool and streaming-commons.

Copyright(c) 2014, Peter Trško
LicenseBSD3
Maintainerpeter.trsko@gmail.com
Stabilityunstable (internal module)
PortabilityDeriveDataTypeable, NoImplicitPrelude, RecordWildCards
Safe HaskellSafe
LanguageHaskell2010

Data.ConnectionPool.Internal.ResourcePoolParams

Contents

Description

Internal packages are here to provide access to internal definitions for library writers, but they should not be used in application code.

Preferably use qualified import, e.g.:

import qualified Data.ConnectionPool.Internal.ResourcePoolParams
  as Internal

Surprisingly this module doesn't depend on resource-pool package and it would be good if it stayed that way, but not at the cost of crippling functionality.

Importantly this package should not depend on streaming-commons package or other modules of this package.

Please, bear above in mind when doing modifications.

Synopsis

ResourcePoolParams

Lenses

numberOfResourcesPerStripe :: Functor f => (Int -> f Int) -> ResourcePoolParams -> f ResourcePoolParams Source

Lens for accessing maximum number of resources to keep open per stripe. The smallest acceptable value is 1 (default).

numberOfStripes :: Functor f => (Int -> f Int) -> ResourcePoolParams -> f ResourcePoolParams Source

Lens for accessing stripe count. The number of distinct sub-pools to maintain. The smallest acceptable value is 1 (default).

resourceIdleTimeout :: Functor f => (NominalDiffTime -> f NominalDiffTime) -> ResourcePoolParams -> f ResourcePoolParams Source

Lens for accessing amount of time for which an unused resource is kept open. The smallest acceptable value is 0.5 seconds (default).

Validation

validateResourcePoolParams Source

Arguments

:: ResourcePoolParams

Parameters to validate.

-> Either String ResourcePoolParams

Either error message or the same value of ResourcePoolParams passed as a first argument.

Check if all parameters for underlying resource pool are valid:

For more details see createPool.

Since version 0.1.1.0.