Module: createTaskProcessorWorker

Creates an adapter function to allow a calculation function to operate as a Web Worker, paired with TaskProcessor, to receive tasks and return results.
Parameters:
Name Type Description
workerFunction createTaskProcessorWorker~WorkerFunction The calculation function, which takes parameters and returns a result.
Source:
See:
Returns:
A function that adapts the calculation function to work as a Web Worker onmessage listener with TaskProcessor.
Type
createTaskProcessorWorker~TaskProcessorWorkerFunction
Example
function doCalculation(parameters, transferableObjects) {
  // calculate some result using the inputs in parameters
  return result;
}

return Cesium.createTaskProcessorWorker(doCalculation);
// the resulting function is compatible with TaskProcessor