unliftio-pool-0.4.3.0: Data.Pool generalized to MonadUnliftIO.
Safe HaskellSafe-Inferred
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 in the pool.

If set to Nothing (the default value), the pool will create the amount of stripes equal to the number of capabilities. This ensures that threads never compete over access to the same stripe and results in a very good performance in a multi-threaded environment.

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 #