Options
All
  • Public
  • Public/Protected
  • All
Menu

Wrap a JobOrderer in an AsyncIterable. This exposes the jobs as a linear sequence that can be iterated over. The sequence can be controller and interrupted, which affects all users.

Hierarchy

  • IterableJobOrderer

Implements

  • AsyncIterable<Job>

Index

Constructors

constructor

  • Simply wrap the given job orderer.

    Parameters

    Returns IterableJobOrderer

Properties

Readonly Private #emitter

#emitter: EventEmitter = ...

An internal event hub used for notifying already-started async iterators.

Readonly Private #orderer

#orderer: JobOrderer

The wrapped job orderer that actually sequences the jobs.

Methods

[Symbol.asyncIterator]

  • [Symbol.asyncIterator](): AsyncIterator<Job, any, undefined>
  • Implement an async iterator. It will be done when the job orderer is done, in which case the value will be undefined.

    Returns AsyncIterator<Job, any, undefined>

cancel

  • cancel(): void
  • Cause all consumers of this iterable to quit with a StopJobOrdererIteration. TODO: Use an AbortController instead.

    Returns void

reportCompleted

  • reportCompleted(job: Job): void
  • Notify all consumers that the given job has completed.

    Parameters

    • job: Job

      The job that completed.

    Returns void

reportFailed

  • reportFailed(job: Job): void
  • Notify all consumers that the given job has failed and should be re-queued.

    Parameters

    • job: Job

      The job that failed to complete.

    Returns void

Generated using TypeDoc