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

Copyright(c) 2014 Peter Trsko
LicenseBSD3
Maintainerpeter.trsko@gmail.com
Stabilityunstable (internal module)
Portabilitynon-portable (DeriveDataTypeable, FlexibleContexts, NoImplicitPrelude)
Safe HaskellNone
LanguageHaskell2010

Data.ConnectionPool.Internal.ConnectionPool

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.ConnectionPool as Internal

This module doesn't depend on streaming-commons and other non-HaskellPlatform packages with notable exception of resource-pool. Another notable thing is that this package is not OS specific. Please, bear this in mind when doing modifications.

Synopsis

Documentation

newtype ConnectionPool a Source

Simple specialized wrapper for Pool.

Constructors

ConnectionPool (Pool (Socket, a)) 

Instances

createConnectionPool Source

Arguments

:: IO (Socket, a)

Acquire a connection which is represented by a Socket. There might be additional information associated with specific connection that we pass as a sencond value in a tuple. Such information are considered read only and aren't passed to release function (see next argument).

-> (Socket -> IO ())

Release a connection which is represented by a Socket.

-> ResourcePoolParams

Data type representing all createPool parameters that describe internal Pool parameters.

-> IO (ConnectionPool a)

Created connection pool that is parametrised by additional connection details.

Specialized wrapper for createPool, see its documentation for details.

destroyAllConnections :: ConnectionPool a -> IO () Source

Destroy all connections that might be still open in a connection pool. This is useful when one needs to release all resources at once and not to wait for idle timeout to be reached.

For more details see destroyAllResources.

Since version 0.1.1.0.

withConnection :: MonadBaseControl IO m => ConnectionPool a -> (Socket -> a -> m r) -> m r Source

Specialized wrapper for withConnection.