WorkerThread
Source: thread.js:271
Worker thread.
Constructor
new WorkerThread(parentPool: ThreadPool): WorkerThreadParameters
parentPool(ThreadPool) — The parent pool.
Instance Methods
getId(): string
Get the thread ID.
Returns
string— The thread ID (alphanumeric).
run(workerTask: WorkerTask)
Run a worker task.
Parameters
workerTask(WorkerTask) — The task to run.
stop()
Finish a task.
Instance Fields
parentPool: ThreadPool
id: string
runningTask: WorkerTask
worker: Worker
onmessage
Message event handler. For now assume we only get a single callback from a worker which also indicates the end of this worker.
Parameters
event(object) — The message event.
onerror
Error event handler.
Parameters
event(object) — The error event.