Options
All
  • Public
  • Public/Protected
  • All
Menu

Set of named PQueues. When a task is done, it checks for pending tasks. No pending tasks means PQueue for the name is removed and garbage collected.

Hierarchy

  • NamedTaskQueue

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly lanes

lanes: Map<string, TaskQueue>

Methods

add

  • add(name: string, task: () => Promise<void>): void
  • Add task to the queue, fire-and-forget semantics.

    All the tasks added under the same name are executed sequentially. Tasks with different names are executed in parallel.

    Parameters

    • name: string
    • task: () => Promise<void>
        • (): Promise<void>
        • Returns Promise<void>

    Returns void

close

  • close(): Promise<void>

onIdle

  • onIdle(): Promise<void>

pause

  • pause(): void

run

  • run<A>(name: string, task: () => Promise<A>): Promise<A>
  • Add task to the queue, wait for the execution.

    All the tasks added under the same name are executed sequentially. Tasks with different names are executed in parallel.

    Returns result of the task execution.

    Type parameters

    • A

    Parameters

    • name: string
    • task: () => Promise<A>
        • (): Promise<A>
        • Returns Promise<A>

    Returns Promise<A>