HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Modulecabal-install-3.16.0.0Haskell2010

Distribution.Client.JobControl

A job control concurrency abstraction

  • 3 types
  • 16 values
datadata JobControl (m :: Type -> Type) a
#

A simple concurrency abstraction. Jobs can be spawned and can complete in any order. This allows both serial and parallel implementations.

Make a JobControl that executes all jobs serially and in order. It only executes jobs on demand when they are collected, not eagerly.

Cancelling will cancel all jobs that have not been collected yet.

Make a JobControl that eagerly executes jobs in parallel, with a given maximum degree of parallelism.

Cancelling will cancel jobs that have not yet begun executing, but jobs that have already been executed or are currently executing cannot be cancelled.

valuecancelJobs :: JobControl m a -> m ()
#

Try to cancel any outstanding but not-yet-started jobs. Call remainingJobs after this to find out if any jobs are left (ie could not be cancelled).

newtypenewtype Lock
#

Higher level utils

3 declarations
valuemapConcurrentWithJobs :: JobControl IO b -> (a -> IO b) -> [a] -> IO [b]
#

Concurrently execute actions on a list using the given JobControl. The maximum number of concurrent jobs is tied to the JobControl instance. The resulting list does not preserve the original order!