Opens an execution for a job, resolves the service lookups the job makes against the bindings it was created with,
and disposes the instances constructed along the way once the job settles.
Every invocation stands on its own: services are constructed on demand, shared within that invocation alone, and
disposed when it ends. Concurrent invocations share no instances. The promise handed back resolves to the value the
job produces, settling only after disposal has completed, and rejects if the executor is invoked from within a
running execution.
Important
Services implementing AsyncDisposable or Disposable are disposed in reverse construction order,
whether the job succeeded or failed, the asynchronous protocol taking precedence where both are implemented;
instances implementing neither are left as they are, which is not an error. Disposal runs outside the execution,
so a disposer resolving a service is rejected rather than constructing an instance nothing would dispose. Every
disposer is run even if an earlier one failed: if the job and a disposal both fail, or several disposals fail, the
errors are collected into an AggregateError, in the order they were raised.
Job executor.
Opens an execution for a job, resolves the service lookups the job makes against the bindings it was created with, and disposes the instances constructed along the way once the job settles.
Every invocation stands on its own: services are constructed on demand, shared within that invocation alone, and disposed when it ends. Concurrent invocations share no instances. The promise handed back resolves to the value the job produces, settling only after disposal has completed, and rejects if the executor is invoked from within a running execution.
Services implementing AsyncDisposable or Disposable are disposed in reverse construction order, whether the job succeeded or failed, the asynchronous protocol taking precedence where both are implemented; instances implementing neither are left as they are, which is not an error. Disposal runs outside the execution, so a disposer resolving a service is rejected rather than constructing an instance nothing would dispose. Every disposer is run even if an earlier one failed: if the job and a disposal both fail, or several disposals fail, the errors are collected into an AggregateError, in the order they were raised.