inline fun <R> withWorker(
name: String? = null,
errorReporting: Boolean = true,
block: Worker.() -> R
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.
Return value returned by the block.