Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WorkerPool

Helper class to push actions to a pool of workers.

Hierarchy

Implements

Index

Constructors

Methods

Constructors

constructor

  • new WorkerPool(workers: Array<Worker>): WorkerPool
  • Constructor

    Parameters

    • workers: Array<Worker>

      Array of workers to use for actions

    Returns WorkerPool

Methods

disposeSearch playground for dispose

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

    Returns void

pushSearch playground for push

  • 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
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method