HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulecabal-install-3.18.1.0Haskell2010

Distribution.Client.JobControl

A job control concurrency abstraction

Contents
  1. Higher level utils
Synopsis
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.

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

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!