potoki-core 2.2.11 → 2.2.12
raw patch · 4 files changed
+9/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Potoki.Core.Transform: concurrentlyWithBatching :: Int -> Int -> Transform a b -> Transform a b
Files
- library/Potoki/Core/Transform.hs +1/−0
- library/Potoki/Core/Transform/Concurrency.hs +7/−0
- potoki-core.cabal +1/−1
- test/Transform.hs +0/−1
library/Potoki/Core/Transform.hs view
@@ -37,6 +37,7 @@ N.concurrently, N.unsafeConcurrently, N.async,+ N.concurrentlyWithBatching, -- * File IO deleteFile, appendBytesToFile,
library/Potoki/Core/Transform/Concurrency.hs view
@@ -3,6 +3,7 @@ import Potoki.Core.Prelude hiding (take, takeWhile, filter) import Potoki.Core.Transform.Instances ()+import Potoki.Core.Transform.Basic import Potoki.Core.Types import qualified Potoki.Core.Fetch as A import qualified Acquire.Acquire as M@@ -150,3 +151,9 @@ then empty else return Nothing in atomically (readChan <|> terminate)++concurrentlyWithBatching :: Int -> Int -> Transform a b -> Transform a b+concurrentlyWithBatching batching concurrency transform =+ chunk batching >>> bufferize concurrency >>>+ unsafeConcurrently concurrency (vector >>> transform >>> chunk batching) >>>+ vector
potoki-core.cabal view
@@ -1,5 +1,5 @@ name: potoki-core-version: 2.2.11+version: 2.2.12 synopsis: Low-level components of "potoki" description: Provides everything required for building custom instances of
test/Transform.hs view
@@ -25,7 +25,6 @@ gen = do list <- listOf (choose (0, 1000 :: Int)) chunkSize <- frequency [(1000, choose (1, 3)), (100, choose (4, 100)), (1, pure 0)]- traceShowM (list, chunkSize) return (list, chunkSize) in forAll gen $ \ (list, chunkSize) -> let listChunks = if chunkSize < 1 then [] else SplitList.chunksOf chunkSize list