withWorker
Executes block with new Worker as resource, by starting the new worker, calling provided block (in current context) with newly started worker as this and terminating worker after the block completes. Note that this operation is pretty heavyweight, use preconfigured worker or worker pool if need to execute it frequently.
Parameters
errorReporting
- controls if uncaught errors in worker to be reported.
Return value returned by the block.