Options
All
  • Public
  • Public/Protected
  • All
Menu

A client-side class responsible for managing a set of web workers. This interface is accessed as a singleton instance via game.workers.

see

Game#workers

Hierarchy

  • WorkerManager

Index

Constructors

Methods

  • createWorker(name: string, config?: any): Promise<AsyncWorker>
  • Create a new named Worker.

    Parameters

    • name: string

      The named Worker to create

    • config: any = {}

    Returns Promise<AsyncWorker>

    The created AsyncWorker which is ready to accept tasks

  • Get a currently active Worker by name.

    Parameters

    • name: string

      The named Worker to retrieve

    Returns AsyncWorker

    The AsyncWorker instance

  • retireWorker(name: string): void
  • Retire a current Worker, terminating it immediately.

    see

    Worker#terminate

    Parameters

    • name: string

      The named worker to terminate

    Returns void

Properties

workforce: Map<string, AsyncWorker> = ...

The currently active workforce.

WORKER_TASK_ACTIONS: { INIT: string; LOAD: string; EXECUTE: string } = ...

Supported worker task actions

Type declaration

  • INIT: string
  • LOAD: string
  • EXECUTE: string