Options
All
  • Public
  • Public/Protected
  • All
Menu

A stupidly simple queueing mechanism that guarantees order of execution, based on a first-come-first-serve precedent.

Hierarchy

  • CommandQueue

Index

Constructors

constructor

Properties

Readonly activeContextChange

activeContextChange: Observable<null | CommandContext<any>> = ...

Emits when the running context has shifted to a new value. Emits null when there is no running context.

Readonly results

results: Observable<CommandContext<any>> = ...

Stream of context results that will be emitted as each action finishes (either with a result or with an error)

Readonly rootConfig

rootConfig: CommandConfig<any> = ...

Fallback command options that will be used when not supplied in one of the enqueueing methods.

Accessors

activeCommandAbortSignal

activeContext

isDestroyed

  • get isDestroyed(): boolean
  • Returns true if this queue has been destroyed.

    Returns boolean

pendingCommandAbortSignal

Methods

abort

  • Used to kill queued and active command contexts. Run this with type ALL as a last stage cleanup option when resetting state.

    Parameters

    Returns void

add

  • Add an action to the queue for pending execution. Does not execute until all preceding tasks have completed.

    Type parameters

    • T

    Parameters

    Returns Promise<T>

createConfig

  • Generates a configuration instance by filling in missing properties from the given config with known ones from the root config.

    Type parameters

    • T

    Parameters

    Returns CommandConfig<T>

destroy

  • destroy(): void
  • Tear-down option that cleans up the internal rxjs refs. CommandQueue references should be disposed of after this is called.

    Returns void

observe

  • observe<T>(action: () => Observable<T>, config?: CommandConfig<Observable<T>>): Observable<T>
  • Special flavor of add() whose value is a pending observable. The inner observable will not be created until all preceding tasks have completed.

    Type parameters

    • T

    Parameters

    • action: () => Observable<T>
        • (): Observable<T>
        • Returns Observable<T>

    • Optional config: CommandConfig<Observable<T>>

    Returns Observable<T>

Generated using TypeDoc