• Creates an AsyncIterable of JobSettlement<J> from a sequence of jobs J that you provide. It will manage the launching and tracking of your jobs within the (e.g. concurrency, interval, timeout, retry) constraints defined by your options.

    Consume the resulting AsyncIterable with for await...of sequence or await sequence.next() to get the next settlement.

    A JobSettlement<J> is equivalent to the values returned by Promise.allSettled(). It will have either status:"fulfilled", value:Awaited<ReturnType<J>> or status:"rejected", reason:unknown. However, it has an additional typed member job:J referencing the job which is being settled. You can add arbitrary annotations to your jobs that will help you when consuming settlements.

    See documentation of NevermoreOptions for more on the available behaviours.

    Type Parameters

    • J extends Job<unknown>

    Parameters

    • options: NevermoreOptions

      The combined options for all behaviours needed in the pipeline.

    • jobSequence: Iterable<J> | AsyncIterable<J> | (() => Generator<J, any, unknown>) | (() => AsyncGenerator<J, any, unknown>)

      An array, generator or other Iterable. Nevermore will pull jobs from it just-in-time.

    Returns AsyncIterable<JobSettlement<J>>

    AsyncIterable sequence of JobSettlement values.