Optional
[asyncIf the worker supports Symbol.asyncDispose the runtime will invoke when the worker is no longer needed. This happens if:
The worker is a PromiseLike that resolves
The worker's construction status changed as noted above
The runtime is canceled via RuntimeService.cancel
Optional
[dispose]Workers may implement Symbol.dispose to handle disposal. Works the same as the async equivalent.
Optional
[label]If label is present, it will be presented in diagnostics. This takes precedence over [Diagnostic.value].
Optional
[value]In diagnostics workers render using toString() unless they provide explicit diagnostics.
Optional
constructionIf the worker supports Construction, the runtime will monitor the worker's lifecycle:
If the worker crashed (e.g. experiences an error during initialization) the runtime will cancel all workers and exit
If the worker is destroyed the runtime deletes it from the set of known workers
The runtime tracks individual discrete tasks as "workers".
The state of the runtime is dependent on installed workers. Any JS object may be a worker but the runtime's interaction with workers varies as documented here.
If a worker is a PromiseLike the runtime will delete and/or destroy it on completion.