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

  • Map
    • WorkerManager

Properties

WORKER_TASK_ACTIONS: Readonly<{
    INIT: "init";
    LOAD: "load";
    EXECUTE: "execute";
}> = ...

Supported worker task actions

Type declaration

  • INIT: "init"
  • LOAD: "load"
  • EXECUTE: "execute"

Methods

  • Create a new named Worker.

    Parameters

    • name: string

      The named Worker to create

    • Optional config: object = {}

      Worker configuration parameters passed to the AsyncWorker constructor

    Returns Promise<AsyncWorker>

    The created AsyncWorker which is ready to accept tasks

  • Retire a current Worker, terminating it immediately.

    Parameters

    • name: string

      The named worker to terminate

    Returns void

    See

    Worker#terminate