Class LifecycleSerial

Orders asynchronous lifecycle operations and invalidates pending starts synchronously.

A start takes a LifecycleSerial.stamp before its first await and checks LifecycleSerial.allows before it publishes anything; a suspension or an end calls LifecycleSerial.invalidate at once, before it queues its own work, so a start still in flight can never publish after it. An end (invalidate(true)) is irreversible.

Accessors

Constructors

Methods

Accessors

Constructors

Methods

  • Runs work after every operation queued before it, whether those resolved or rejected; answers its result.

    Type Parameters

    • T

    Parameters

    • work: (() => Promise<T>)
        • (): Promise<T>
        • Returns Promise<T>

    Returns Promise<T>