async-extra-0.1.0.0: Useful concurrent combinators

Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.Async.Extra

Contents

Synopsis

concurrent mapping

mapConcurrentlyBounded :: Traversable t => Int -> (a -> IO b) -> t a -> IO (t b) Source #

Span a green thread for each task, but only execute N tasks concurrently.

mapConcurrentlyBatched :: (NFData b, Foldable t) => Int -> (Seq (Seq b) -> IO r) -> (a -> IO b) -> t a -> IO r Source #

Span green threads to perform N (batch size) tasks in one thread and merge results using provided merge function

mapConcurrentlyChunks :: (NFData b, Foldable t) => Int -> (Seq (Seq b) -> IO r) -> (t a -> Int) -> (a -> IO b) -> t a -> IO r Source #

Split input into N chunks with equal length and work on each chunk in a dedicated green thread. Then merge results using provided merge function

merge strategies

mergeConcatAll :: Seq (Seq a) -> [a] Source #

Merge all chunks by combining to one list