Interface IWorkerNode<Worker, Data>Internal

Worker node interface.

Type Parameters

  • Worker extends IWorker

    Type of worker.

  • Data = unknown

    Type of data sent to the worker. This can only be structured-cloneable data.

Hierarchy

  • IWorkerNode

Properties

clearTasksQueue: (() => void)

Type declaration

    • (): void
    • Clears tasks queue.

      Returns void

closeChannel: (() => void)

Type declaration

    • (): void
    • Close communication channel.

      Returns void

dequeueTask: (() => undefined | Task<Data>)

Type declaration

    • (): undefined | Task<Data>
    • Dequeue task.

      Returns undefined | Task<Data>

      The dequeued task.

enqueueTask: ((task) => number)

Type declaration

    • (task): number
    • Enqueue task.

      Parameters

      • task: Task<Data>

        The task to queue.

      Returns number

      The task queue size.

getTaskWorkerUsage: ((name) => undefined | WorkerUsage)

Type declaration

    • (name): undefined | WorkerUsage
    • Gets task worker usage statistics.

      Parameters

      • name: string

      Returns undefined | WorkerUsage

Worker info.

resetUsage: (() => void)

Type declaration

    • (): void
    • Resets usage statistics .

      Returns void

tasksQueueSize: (() => number)

Type declaration

    • (): number
    • Tasks queue size.

      Returns number

      The tasks queue size.

Worker usage statistics.

worker: Worker

Worker.

Generated using TypeDoc