HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulescheduler-2.0.1.0Haskell2010

Control.Scheduler.Types

  • 15 types
  • 1 value
  • Packagescheduler-2.0.1.0
  • Exports16
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceTypes.hs
datadata Scheduler s a
#

Main type for scheduling work. See withScheduler or withScheduler_ for ways to construct and use this data type.

Constructors

  • Scheduler
    • _numWorkers :: !Int
    • _scheduleWorkId :: (WorkerId -> ST s a) -> ST s ()
    • _terminate :: Early a -> ST s a
    • _waitForCurrentBatch :: ST s (Results a)
    • _earlyResults :: ST s (Maybe (Results a))
    • _currentBatchId :: ST s BatchId

      Returns an opaque identifier for current batch of jobs, which can be used to either cancel the batch early or simply check if the batch has finished or not.

    • _cancelBatch :: BatchId -> Early a -> ST s Bool

      Stops current batch and cancells all the outstanding jobs and the ones that are currently in progress.

    • _batchEarly :: ST s (Maybe (Early a))
datadata WorkerStates ws
#

Each worker is capable of keeping it's own state, that can be share for different schedulers, but not at the same time. In other words using the same WorkerStates on Control.Scheduler.withSchedulerS concurrently will result in an error. Can be initialized with initWorkerStates

Constructors

datadata Batch s a
#

Batch is an artifical checkpoint that can be controlled by the user throughout the lifetime of a scheduler.

Constructors

  • Batch
    • batchCancel :: a -> ST s Bool
    • batchCancelWith :: a -> ST s Bool
    • batchHasFinished :: ST s Bool
newtypenewtype BatchId
#

This identifier is needed for tracking batches.

Constructors

  • BatchId
    • getBatchId :: Int
Instances3Eq, Ord, Show
  • Eq BatchIdDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Ord BatchIdDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Show BatchIdDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
datadata Jobs (m :: Type -> Type) a
#

Constructors

  • Jobs
    • jobsNumWorkers :: !Int
    • jobsQueue :: !JQueue m a
    • jobsQueueCount :: !PVar Int RealWorld
    • jobsSchedulerStatus :: !MVar SchedulerStatus
datadata Early a
#

This is a result for premature ending of computation.

Constructors

  • Early a

    This value along with all results computed up to the moment when computation was cancelled or termianted will be returned

  • EarlyWith a

    Only this value will be returned all other results will get discarded

valueunEarly :: Early a -> a
#
datadata Results a
#

Computed results of scheduled jobs.

Constructors

Instances8Functor, Foldable, Traversable, Eq1, Show1, Eq, …
  • Functor ResultsDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Foldable ResultsDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Traversable ResultsDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Eq1 ResultsDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Show1 ResultsDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Eq a => Eq (Results a)Defined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Read a => Read (Results a)Defined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Show a => Show (Results a)Defined in scheduler-2.0.1.0 · Control.Scheduler.Types
datadata SchedulerStatus
#

Constructors

  • SchedulerIdle
  • SchedulerWorkerException WorkerException
newtypenewtype WorkerException
#

This exception should normally be never seen in the wild and is for internal use only.

Constructors

Instances2Show, Exception
  • Show WorkerExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Exception WorkerExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
datadata CancelBatchException
#
Instances2Show, Exception
  • Show CancelBatchExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Exception CancelBatchExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
datadata TerminateEarlyException
#
Instances2Show, Exception
  • Show TerminateEarlyExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Exception TerminateEarlyExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
datadata WorkerTerminateException
#

Constructors

  • WorkerTerminateException

    When a co-worker dies of some exception, all the other ones will be terminated asynchronously with this one.

Instances2Show, Exception
  • Show WorkerTerminateExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types
  • Exception WorkerTerminateExceptionDefined in scheduler-2.0.1.0 · Control.Scheduler.Types