Creates a new executor manager.
Additional options.
Protected
Readonly
_The map from a key to an executor.
Protected
Readonly
_The map from a key ID to an initial state that must be set to an executor before plugins are applied. Entries from this map are deleted after the executor is created.
Protected
Readonly
_Plugins that are applied to all executors.
Protected
Readonly
_The pubsub that handles the manager subscriptions.
Readonly
keyReturns the unique comparable ID for the executor key.
Iterates over executors created by the manager.
Deletes the non-active executor from the manager.
If the detached executor is pending then it is not aborted. Subscribe to the detach event on either manager or an executor and abort it manually.
The key of the executor to delete.
true
if the executor was detached, or false
if there's no such executor, or the executor is active.
Returns an executor by its key, or undefined
if there's no such executor.
The unique executor key.
Resolves with the existing executor or waits for an executor to be created.
The executor key to wait for.
Returns an existing executor or creates a new one.
The unique executor key.
The initial executor value.
Optional
plugins: (undefined | null | ExecutorPlugin<Value>)[]The array of plugins that are applied to the newly created executor.
Returns an existing executor or creates a new one.
The unique executor key.
Optional
initialValue: Value | ExecutorTask<Value> | PromiseLike<Value>The initial executor value.
Optional
plugins: (undefined | null | ExecutorPlugin<NoInfer<Value>>)[]The array of plugins that are applied to the newly created executor.
Injects the initial state for the executor that can be created in the future.
The unique executor key.
The initial state of the hydrated executor that can be created via ExecutorManager.getOrCreate.
true
if the executor has been hydrated, or false
if the executor has already been created and
therefore cannot be hydrated.
Subscribes a listener to the events published by all executors that are created by this manager.
The listener to subscribe.
The callback that unsubscribes the listener.
Creates executors and manages their lifecycle.