Interface ExecutorEvent<Value>

The event published by the Executor.

Lifecycle events:

"attached"
The executor was just created, plugins were applied to it, and it was attached to the manager.
"detached"
The executor was just detached: it was removed from the manager and all of its subscribers were unsubscribed.
"activated"
The executor was inactive and became active. This means that there are consumers that observe the state of the executor.
"deactivated"
The executor was active and became inactive. This means that there are no consumers that observe the state of the executor.
"pending"
The executor started an Executor.task execution.
"fulfilled"
The executor was fulfilled with a value.
"rejected"
The executor was rejected with a reason.
"aborted"
The latest task was aborted.

If executor is still pending when abort event is published then the currently pending task is being replaced with a new task.

Calling Executor.execute when handling an abort event may lead to stack overflow. If you need to do this anyway, execute a new task from async context using queueMicrotask or similar API.

"cleared"
The executor was cleared and now isn't settled.
"invalidated"
The result stored in the executor was invalidated.
"annotated"
Annotations associated with the executor were patched.
"plugin_configured"
The configuration of the plugin associated with the executor was updated.
interface ExecutorEvent<Value> {
    payload: any;
    target: Executor<Value>;
    type: "pending" | "activated" | "fulfilled" | "rejected" | string & {} | "plugin_configured" | "attached" | "annotated" | "aborted" | "cleared" | "invalidated" | "deactivated" | "detached";
    version: number;
}

Type Parameters

  • Value = any

    The value stored by the executor.

Properties

payload: any

The payload carried by the event, or undefined if there's no payload.

target: Executor<Value>

The executor for which the lifecycle event has occurred.

type: "pending" | "activated" | "fulfilled" | "rejected" | string & {} | "plugin_configured" | "attached" | "annotated" | "aborted" | "cleared" | "invalidated" | "deactivated" | "detached"

The type of the event.

See ExecutorEvent for more details.

version: number

The version of the executor for which this event was published.