Options
All
  • Public
  • Public/Protected
  • All
Menu

Helper class to push actions to a pool of workers.

Hierarchy

Implements

Index

Constructors

Methods

Constructors

  • Constructor

    Parameters

    • workers: Worker[]

      Array of workers to use for actions

    Returns WorkerPool

Methods

  • dispose(): void
  • Terminates all workers and clears any pending actions.

    Returns void

  • push(action: ((worker: Worker, onComplete: (() => void)) => void)): void
  • Pushes an action to the worker pool. If all the workers are active, the action will be pended until a worker has completed its action.

    Parameters

    • action: ((worker: Worker, onComplete: (() => void)) => void)

      The action to perform. Call onComplete when the action is complete.

        • (worker: Worker, onComplete: (() => void)): void
        • Parameters

          • worker: Worker
          • onComplete: (() => void)
              • (): void
              • Returns void

          Returns void

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme