packages feed

resource-pool 0.1.1.0 → 0.2.0.0

raw patch · 2 files changed

+5/−4 lines, 2 filesdep +monad-controldep −MonadCatchIO-transformersPVP ok

version bump matches the API change (PVP)

Dependencies added: monad-control

Dependencies removed: MonadCatchIO-transformers

API changes (from Hackage documentation)

- Data.Pool: withResource :: MonadCatchIO m => Pool a -> (a -> m b) -> m b
+ Data.Pool: withResource :: MonadControlIO m => Pool a -> (a -> m b) -> m b

Files

Data/Pool.hs view
@@ -29,9 +29,10 @@ import Control.Concurrent (forkIO, killThread, myThreadId, threadDelay) import Control.Concurrent.STM import Control.Exception (SomeException, catch)+import Control.Exception.Control (onException) import Control.Monad (forM_, forever, join, liftM2, unless, when)-import Control.Monad.CatchIO (MonadCatchIO, onException) import Control.Monad.IO.Class (liftIO)+import Control.Monad.IO.Control (MonadControlIO) import Data.Hashable (hash) import Data.List (partition) import Data.Time.Clock (NominalDiffTime, UTCTime, diffUTCTime, getCurrentTime)@@ -164,7 +165,7 @@ -- destroy a pooled resource, as doing so will almost certainly cause -- a subsequent user (who expects the resource to be valid) to throw -- an exception.-withResource :: MonadCatchIO m => Pool a -> (a -> m b) -> m b+withResource :: MonadControlIO m => Pool a -> (a -> m b) -> m b {-# SPECIALIZE withResource :: Pool a -> (a -> IO b) -> IO b #-} withResource Pool{..} act = do   i <- liftIO $ ((`mod` numStripes) . hash) <$> myThreadId
resource-pool.cabal view
@@ -1,5 +1,5 @@ name:                resource-pool-version:             0.1.1.0+version:             0.2.0.0 synopsis:            A high-performance striped resource pooling implementation description:   A high-performance striped pooling abstraction for managing@@ -30,7 +30,7 @@   build-depends:            base == 4.*,     hashable,-    MonadCatchIO-transformers,+    monad-control >= 0.2.0.1,     transformers,     stm,     time,