Constructor
new WorkerThread(parentPool)
Parameters:
Name | Type | Description |
---|---|---|
parentPool | ThreadPool | The parent pool. |
- Source
Members
id :string
Type:
- string
- Source
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
parentPool :ThreadPool
Type:
- Source
runningTask :WorkerTask
Type:
- Source
worker :Worker
Type:
- 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 | WorkerTask | The task to run. |
- Source
stop()
Finish a task and tell the parent.
- Source