Quartz Headless docs/LatestRequest

Search documentation

Type to search the documentation.

API: Primitives

LatestRequest

Interface reference for LatestRequest.

Overview

Declaration

interface LatestRequest

Public methods

run

run<R>(task: (signal: AbortSignal) => Promise<R>): Promise<R | undefined>

Runs task as the current request. Any earlier request is aborted (its AbortSignal fires) and its result is discarded even if the task ignores the signal. Resolves with the result, or undefined when the request was superseded, cancelled or aborted.

Parameter Type Optional Description
task (signal: AbortSignal) => Promise<R>

cancel

cancel(): void

Aborts the in-flight request, if any. Called automatically when the owner is destroyed.