The value stored by the executor.
ReadonlyannotationsThe map of annotations associated with the executor.
ReadonlyinvalidatedThe timestamp when the executor was invalidated, or 0 if the executor isn't invalidated.
Readonlyistrue if the executor was activated more times than deactivated.
Readonlyistrue if the executor was fulfilled with a value, or false otherwise.
Readonlyistrue if invalidate was called on a settled executor and
a new settlement hasn't occurred yet.
Readonlyistrue if the execution is currently pending, or false otherwise.
Readonlyistrue if the executor was rejected with a reason, or false otherwise.
ReadonlyisReadonlykeyThe key of this executor, unique in scope of the manager.
ReadonlymanagerThe manager that created the executor.
ReadonlypromiseThe promise of the pending task execution, or null if there's no pending task execution.
Note: This promise is aborted if the task is replaced. Use getOrAwait to wait until the executor becomes settled.
ReadonlyreasonThe reason of the latest failure.
Note: An executor may still have a rejection reason even if it was fulfilled. Check isRejected to ensure that an executor is actually rejected.
ReadonlysettledThe timestamp when the executor was settled, or 0 if it isn't settled.
The latest task that was executed, or null if the executor hasn't executed any tasks.
Note: Unlike ReadonlyExecutor.task, this property is writable to allow plugins and advanced use cases to replace the stored task reference directly.
ReadonlyvalueThe value of the latest fulfillment.
Note: An executor may still have a value even if it was rejected. Use get, getOrDefault, or getOrAwait to retrieve the value of a fulfilled executor.
ReadonlyversionThe integer version of the state of this executor that is incremented every time the executor is mutated.
Instantly aborts pending execution and preserves available results as-is. The value (or error) returned from the pending task callback is ignored, and the signal passed to the task callback is aborted.
Note: This method only affects the pending task promise, not the executor's settled state. To also clear or reject the executor's value, call clear or reject afterwards.
Optionalreason: unknownThe abort reason used to reject the pending task promise.
Marks the executor as being actively monitored by an external consumer.
An activated executor stays active until all returned deactivate callbacks are invoked.
The callback that deactivates the executor if there are no more active consumers.
Merges the patch into the existing annotations.
The patch containing new annotations.
Clears available results and doesn't affect the pending task execution.
The latest task can still be retried after the executor is cleared.
Executes a task and populates the executor with the returned result.
Instantly aborts pending execution (if any), marks the executor as pending and then invokes the task callback.
If a new task is executed before the returned promise is fulfilled then the signal is aborted and the result is ignored.
The task object or the task callback that returns the new result for the executor to store.
The promise that is resolved with the result of the task.
Waits for the executor to become settled and non-pending. The returned promise is then resolved with a value if the executor is fulfilled, or rejected with a reason if the executor is rejected.
If the executor is detached during this operation, the returned promise is rejected with an AbortError.
The type of the default value.
The default value.
Captures the snapshot of the current executor state.
If the executor is settled, marks the result as invalidated.
OptionalinvalidatedAt: numberThe timestamp to record as the invalidation time. Defaults to Date.now().
Publishes the event to subscribers of the executor and its manager.
The event to publish.
Instantly aborts pending execution and rejects the executor with the reason.
The reason of failure.
OptionalsettledAt: numberThe timestamp when the reason was acquired. Defaults to Date.now().
Aborts pending execution and fulfills the executor with the value.
Note: If the value is a PromiseLike, it is wrapped internally and the task is updated to
reflect the pending resolution. This differs from passing a plain value, where settlement is immediate.
If the executor is not pending, the latest task is executed again. If there's no task then this is a no-op.
Subscribes the listener to changes of the observed value.
The listener to subscribe.
Manages the async task execution process and provides ways to access execution results, abort or replace a task execution, and subscribe to execution state changes.