Package version:

Interface SimplePollerLike<TState, TResult>

A simple poller that can be used to poll a long running operation.

interface SimplePollerLike<TState, TResult> {
    getOperationState(): TState;
    getResult(): undefined | TResult;
    isDone(): boolean;
    isStopped(): boolean;
    onProgress(callback): CancelOnProgress;
    poll(options?): Promise<TState>;
    pollUntilDone(pollOptions?): Promise<TResult>;
    serialize(): Promise<string>;
    stopPolling(): void;
    submitted(): Promise<void>;
    toString(): string;
}

Type Parameters

  • TState extends OperationState<TResult>
  • TResult

Methods

  • Returns 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 undefined | TResult

  • Returns true if the poller has finished polling.

    Returns boolean

  • Returns true if the poller is stopped.

    Returns boolean

  • Invokes the provided callback after each polling is completed, sending the current state of the poller's operation.

    It returns a method that can be used to stop receiving updates on the given callback function.

    Parameters

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

          Returns void

    Returns CancelOnProgress

  • Returns a promise that will resolve once a single polling request finishes. It does this by calling the update method of the Poller's operation.

    Parameters

    • Optional options: {
          abortSignal?: any;
      }
      • Optional abortSignal?: any

    Returns Promise<TState>

  • Returns a promise that will resolve once the underlying operation is completed.

    Parameters

    • Optional pollOptions: {
          abortSignal?: any;
      }
      • Optional abortSignal?: any

    Returns Promise<TResult>

  • Returns a promise that could be used for serialized version of the poller's operation by invoking the operation's serialize method.

    Returns Promise<string>

  • Stops the poller from continuing to poll. Please note this will only stop the client-side polling

    Returns void

    Deprecated

    Use abortSignal to stop polling instead.

  • Wait the poller to be submitted.

    Returns Promise<void>

  • Returns a string representation of the poller's operation. Similar to serialize but returns a string.

    Returns string

    Deprecated

    Use serialize() instead.