File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010* Do not exceed the maximum number of resources if the number of stripes does
1111 not divide it.
1212* Add support for assigning a label to the pool.
13+ * Remove deprecated ` createPool ` function.
1314
1415# resource-pool-0.4.0.0 (2023-01-16)
1516* Require ` poolMaxResources ` to be not smaller than the number of stripes.
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ library
3737 , primitive >= 0.7
3838 , stm
3939 , text
40- , time
4140
4241 ghc-options : -Wall
4342 -Wcompat
Original file line number Diff line number Diff line change @@ -20,16 +20,11 @@ module Data.Pool
2020 , putResource
2121 , destroyResource
2222 , destroyAllResources
23-
24- -- * Compatibility with 0.2
25- , createPool
2623 ) where
2724
2825import Control.Concurrent.STM
2926import Control.Exception
3027import Control.Monad
31- import Data.Text qualified as T
32- import Data.Time (NominalDiffTime )
3328
3429import Data.Pool.Internal
3530
@@ -104,23 +99,6 @@ tryTakeResource pool = mask_ $ do
10499 pure $ pure Nothing
105100 else fmap Just <$> takeAvailableResource pool lp stripe
106101
107- {-# DEPRECATED createPool "Use newPool instead" #-}
108-
109- -- | Provided for compatibility with @resource-pool < 0.3@.
110- --
111- -- Use 'newPool' instead.
112- createPool :: IO a -> (a -> IO () ) -> Int -> NominalDiffTime -> Int -> IO (Pool a )
113- createPool create free numStripes idleTime maxResources =
114- newPool
115- PoolConfig
116- { createResource = create
117- , freeResource = free
118- , poolCacheTTL = realToFrac idleTime
119- , poolMaxResources = numStripes * maxResources
120- , poolNumStripes = Just numStripes
121- , pcLabel = T. empty
122- }
123-
124102----------------------------------------
125103-- Helpers
126104
You can’t perform that action at this time.
0 commit comments