Skip to content

Commit 1f52ba1

Browse files
committed
Remove deprecated createPool function
1 parent eeabc87 commit 1f52ba1

3 files changed

Lines changed: 1 addition & 23 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
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.

resource-pool.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ library
3737
, primitive >= 0.7
3838
, stm
3939
, text
40-
, time
4140

4241
ghc-options: -Wall
4342
-Wcompat

src/Data/Pool.hs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff 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

2825
import Control.Concurrent.STM
2926
import Control.Exception
3027
import Control.Monad
31-
import Data.Text qualified as T
32-
import Data.Time (NominalDiffTime)
3328

3429
import 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

0 commit comments

Comments
 (0)