Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface KVPollerLike<TState, TResult>

Package version

Abstract representation of a poller, intended to expose just the minimal that the user needs to work with.

This edit of the original interface changes getOperationState() to return TState, which helps to expose any re-interpretation of the state of the operation being polled, such as only publicly available properties.

Type parameters

  • TState: PollOperationState<TResult>

  • TResult

Hierarchy

  • KVPollerLike

Implemented by

Index

Methods

cancelOperation

  • cancelOperation(options?: undefined | { abortSignal?: AbortSignal }): Promise<void>
  • A method that will try to cancel the underlying operation.

    Parameters

    • Optional options: undefined | { abortSignal?: AbortSignal }

    Returns Promise<void>

getOperationState

  • getOperationState(): TState
  • A method that will return the state of the operation. TState can be a different type than the underlying operation's TState.

    Returns TState

getResult

  • getResult(): TResult | undefined
  • A method that will return the result value of the operation, regardless of the state of the poller. It can return undefined or an incomplete form of the final TResult value depending on the implementation.

    Returns TResult | undefined

isDone

  • isDone(): boolean

isStopped

  • isStopped(): boolean

onProgress

  • onProgress(callback: (state: TState) => void): CancelOnProgress
  • A method used by the poller operation to report updates.

    Parameters

    • callback: (state: TState) => void
        • (state: TState): void
        • Parameters

          • state: TState

          Returns void

    Returns CancelOnProgress

poll

  • poll(options?: undefined | { abortSignal?: AbortSignal }): Promise<void>
  • A method that defines under what conditions to reach out to the underlying service. It should call the operation's update method.

    Parameters

    • Optional options: undefined | { abortSignal?: AbortSignal }

    Returns Promise<void>

pollUntilDone

  • pollUntilDone(): Promise<TResult>
  • A method that will return a promise that will resolve once the underlying operation is completed.

    Returns Promise<TResult>

stopPolling

  • stopPolling(): void

toString

  • toString(): string

Generated using TypeDoc