unliftio-pool
Safe HaskellNone
LanguageHaskell2010

UnliftIO.Pool

Synopsis

Documentation

type Pool = Pool Source #

data PoolConfig a #

Configuration of a Pool.

setNumStripes :: Maybe Int -> PoolConfig a -> PoolConfig a #

Set the number of stripes (sub-pools) in the pool.

If not explicitly set, the default number of stripes is 1, which should be good for typical use (when in doubt, profile your application first).

If set to Nothing, the pool will create the number of stripes equal to the number of capabilities.

Note: usage of multiple stripes reduces contention, but can also result in suboptimal use of resources since stripes are separated from each other.

Since: resource-pool-0.4.0.0

mkDefaultPoolConfig :: MonadUnliftIO m => m a -> (a -> m ()) -> Double -> Int -> m (PoolConfig a) Source #

newPool :: MonadUnliftIO m => PoolConfig a -> m (Pool a) Source #

Lifted version of newPool

Since: 0.4.2.0

withResource :: MonadUnliftIO m => Pool a -> (a -> m b) -> m b Source #

tryWithResource :: MonadUnliftIO m => Pool a -> (a -> m b) -> m (Maybe b) Source #

destroyResource :: MonadUnliftIO m => Pool a -> LocalPool a -> a -> m () Source #

putResource :: MonadUnliftIO m => LocalPool a -> a -> m () Source #