-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Simple pool
--
-- Provides a simple pool implementation.
@package simpoole
@version 0.0.0
module Simpoole
-- | Pool of resources
data Pool m a
-- | Lift a natural transformation m ~> n to Pool m ~>
-- Pool n.
mapPool :: (forall x. m x -> n x) -> Pool m a -> Pool n a
-- | Create a new pool that has no limit on how many resources it may
-- create and hold.
newUnlimitedPool :: (MonadConc m, MonadIO m) => m a -> (a -> m ()) -> NominalDiffTime -> m (Pool m a)
-- | Similar to newUnlimitedPool but allows you to limit the number
-- of resources that will exist at the same time. When all resources are
-- currently in use, further resource acquisition will block until one is
-- no longer in use.
newPool :: (MonadConc m, MonadIO m, MonadFail m) => m a -> (a -> m ()) -> Int -> NominalDiffTime -> m (Pool m a)
-- | Use a resource from the pool.
withResource :: MonadMask m => Pool m a -> (a -> m r) -> m r
-- | Fetch pool metrics.
poolMetrics :: Pool m a -> m (Metrics Natural)
-- | Pool metrics
data Metrics a
Metrics :: a -> a -> a -> Metrics a
-- | Total number of resources created
[metrics_createdResources] :: Metrics a -> a
-- | Total number of resources destroyed
[metrics_destroyedResources] :: Metrics a -> a
-- | Maximum number of resources that were alive simultaneously
[metrics_maxLiveResources] :: Metrics a -> a
instance Data.Traversable.Traversable Simpoole.Metrics
instance Data.Foldable.Foldable Simpoole.Metrics
instance GHC.Base.Functor Simpoole.Metrics
instance GHC.Show.Show a => GHC.Show.Show (Simpoole.Metrics a)