Constructor
new WorkerThread(parentPool)
Parameters:
Name | Type | Description |
---|---|---|
parentPool | object | The parent pool. |
- Source
Members
onerror
Error event handler.
- Source
onmessage
Message event handler. For now assume we only get a single callback from a worker which also indicates the end of this worker.
- Source
Methods
getId() → {string}
Get the thread ID.
- Source
Returns:
The thread ID (alphanumeric).
- Type:
- string
run(workerTask)
Run a worker task.
Parameters:
Name | Type | Description |
---|---|---|
workerTask | object | The task to run. |
- Source
stop()
Finish a task and tell the parent.
- Source