The name of this worker.
Static
WORKER_A path reference to the JavaScript file which provides companion worker-side functionality.
A Promise which resolves once the Worker is ready to accept tasks
Execute a task on a specific Worker.
The named function to execute on the worker. This function must first have been loaded.
Optional
args: any[] = []An array of parameters with which to call the requested function
Optional
transfer: any[] = []An array of transferable objects which are transferred to the worker thread. See https://developer.mozilla.org/en-US/docs/Glossary/Transferable_objects
A Promise which resolves with the returned result of the function once complete.
Load a function onto a given Worker. The function must be a pure function with no external dependencies or requirements on global scope.
The name of the function to load
A reference to the function that should be loaded
A Promise which resolves once the Worker has loaded the function.
An asynchronous web Worker which can load user-defined functions and await execution using Promises.
Param: name
The worker name to be initialized
Param: options
Worker initialization options
Param: options.debug
Should the worker run in debug mode?
Param: options.loadPrimitives
Should the worker automatically load the primitives library?
Param: options.scripts
Should the worker operates in script modes? Optional scripts.