Copyright | (c) 2014 Peter Trsko |
---|---|
License | BSD3 |
Maintainer | peter.trsko@gmail.com |
Stability | unstable (internal module) |
Portability | non-portable (DeriveDataTypeable, FlexibleContexts, NoImplicitPrelude) |
Safe Haskell | None |
Language | Haskell2010 |
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.
- newtype ConnectionPool a = ConnectionPool (Pool (Socket, a))
- createConnectionPool :: IO (Socket, a) -> (Socket -> IO ()) -> ResourcePoolParams -> IO (ConnectionPool a)
- destroyAllConnections :: ConnectionPool a -> IO ()
- withConnection :: MonadBaseControl IO m => ConnectionPool a -> (Socket -> a -> m r) -> m r
Documentation
newtype ConnectionPool a Source
Simple specialized wrapper for Pool
.
ConnectionPool (Pool (Socket, a)) |
Typeable (* -> *) ConnectionPool |
:: IO (Socket, a) | Acquire a connection which is represented by a |
-> (Socket -> IO ()) | Release a connection which is represented by a |
-> ResourcePoolParams | Data type representing all |
-> 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
.