HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Moduleasync-2.2.6Haskell2010

Control.Concurrent.Stream

Processing streams with a fixed number of worker threads

Synopsis
  • Packageasync-2.2.6
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceStream.hs
valuestream
  1. :: Int

    Maximum Concurrency

  2. -> ((a -> IO ()) -> IO ())

    Producer

  3. -> (a -> IO ())

    Worker

  4. -> IO ()

Maps a fixed number of workers concurrently over a stream of values produced by a producer function. The producer is passed a function to call for each work item. If a worker throws a synchronous exception, it will be propagated to the caller.

valuestreamBound
  1. :: Int

    Maximum Concurrency

  2. -> ((a -> IO ()) -> IO ())

    Producer

  3. -> (a -> IO ())

    Worker

  4. -> IO ()

Like stream, but uses bound threads for the workers. See forkOS for details on bound threads.

valuestreamWithInput
  1. :: ((a -> IO ()) -> IO ())

    Producer

  2. -> [b]

    Worker state

  3. -> (b -> a -> IO ())

    Worker

  4. -> IO ()

Like stream, but each worker is passed an element of an input list.

valuemapConcurrentlyBounded
  1. :: Int

    Maximum concurrency

  2. -> (a -> IO b)

    Function to map over the input values

  3. -> [a]

    List of input values

  4. -> IO [b]

    List of output values

Concurrent map over a list of values, using a bounded number of threads.