Gets the error state of the terminated worker.
A string or Error
that describes the error state of the current worker; undefined
if the
current worker was forcibly terminated via WorkerLike.terminate().
Gets the current worker state.
A WorkerStateFlags value that describes the current state of the worker.
The method that provides the worker implementation when the worker is started.
Sends a message to the worker.
The data that should be posted to the current worker.
A Promise
that resolves once data
has been successfuly sent to the worker.
Starts the current worker.
A Promise
that resolves when the current worker has completed executing.
Signals the current worker to terminate immediately.
Waits until the current worker has completed executing.
A Promise
that resolves when the current worker has completed executing.
Generated using TypeDoc
A base class for all worker implementations.
Derived classes should override the AbstractWorker.onStart(...) method in order to provide an implementation for the worker, and then apply the @worker(...) class decorator to the class so that the worker is started in its own dedicated worker thread based on the current runtime.
All methods and properties of AbstractWorker will throw an error if a derived class has not been decorated with the @worker(...) class decorator.