packages feed

conduit-concurrent-map 0.1.3 → 0.1.4

raw patch · 2 files changed

+12/−6 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.Conduit.ConcurrentMap: concurrentMapM :: (MonadUnliftIO m, MonadResource m) => Int -> Int -> (a -> m b) -> ConduitT a b m ()

Files

conduit-concurrent-map.cabal view
@@ -1,12 +1,12 @@ name:          conduit-concurrent-map-version:       0.1.3+version:       0.1.4 license:       MIT copyright:     2017 Niklas Hambüchen <mail@nh2.me> author:        Niklas Hambüchen <mail@nh2.me> maintainer:    Niklas Hambüchen <mail@nh2.me> category:      Data, Conduit build-type:    Simple-tested-with:   GHC==8.10.7+tested-with:   GHC==8.10.7, GHC==9.8.4, GHC==9.10.1 cabal-version: >= 1.10 homepage:      https://github.com/nh2/conduit-concurrent-map bug-Reports:   https://github.com/nh2/conduit-concurrent-map/issues
src/Data/Conduit/ConcurrentMap.hs view
@@ -5,7 +5,8 @@ -- | Functions for concurrent mapping over Conduits. module Data.Conduit.ConcurrentMap   ( -- * Explicit number of threads-    concurrentMapM_+    concurrentMapM+  , concurrentMapM_     -- * CPU-bound use case   , concurrentMapM_numCaps   ) where@@ -45,7 +46,12 @@   a :< _     -> Just a  --- | @concurrentMapM_ numThreads workerOutputBufferSize f@+-- See #1+concurrentMapM_ :: (MonadUnliftIO m, MonadResource m) => Int -> Int -> (a -> m b) -> ConduitT a b m ()+concurrentMapM_ = concurrentMapM+{-# DEPRECATED concurrentMapM_ "Use concurrentMapM (without _), as this function yields b; in the future, this function may be replaced by one that does not yield b" #-}++-- | @concurrentMapM numThreads workerOutputBufferSize f@ -- -- Concurrent, order-preserving conduit mapping function. --@@ -119,8 +125,8 @@ -- > puts :: (MonadIO m) => String -> m () -- for non-interleaved output -- > puts s = liftIO $ BS8.putStrLn (BS8.pack s) -- > runConduitRes (CL.sourceList [1..6] .| concurrentMapM_ 4 (\i -> liftIO $ puts (show i ++ " before") >> threadDelay (i * 1000000) >> puts (show i ++ " after") >> return (i*2)) .| CL.consume )-concurrentMapM_ :: (MonadUnliftIO m, MonadResource m) => Int -> Int -> (a -> m b) -> ConduitT a b m ()-concurrentMapM_ numThreads workerOutputBufferSize f = do+concurrentMapM :: (MonadUnliftIO m, MonadResource m) => Int -> Int -> (a -> m b) -> ConduitT a b m ()+concurrentMapM numThreads workerOutputBufferSize f = do   when (workerOutputBufferSize < 1) $ do     error $ "Data.Conduit.Concurrent.concurrentMapM_ requires workerOutputBufferSize < 1, got " ++ show workerOutputBufferSize