Creates a new executor manager.
Additional options.
Protected
Readonly
_executorsThe map from a key to an executor.
Protected
Readonly
_initialThe map from a key 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 initialized.
Protected
Readonly
_pluginsPlugins that are applied to all executors.
Protected
Readonly
_pubThe pubsub that handles the manager subscriptions.
Readonly
keySerializes keys of executors.
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.
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 is created in the future.
The initial state of the hydrated executor that can be created via ExecutorManager.getOrCreate.
true
if the executor was hydrated, or false
if the executor already exists and 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.
Returns serializable executor manager state.
Creates executors and manages their lifecycle.