PollOperation interface

PollOperation is an interface that defines how to update the local reference of the state of the remote long running operation, just as well as how to request the cancellation of the same operation.

It also has a method to serialize the operation so that it can be stored and resumed at any time.

Properties

state

The state of the operation. It will be used to store the basic properties of PollOperationState, plus any custom property that the implementation may require.

Methods

cancel({ abortSignal?: AbortSignalLike })

Attempts to cancel the underlying operation.

It only optionally receives an object with an abortSignal property, from @azure/abort-controller's AbortSignalLike.

It returns a promise that should be resolved with an updated version of the poller's operation.

toString()

Serializes the operation. Useful when wanting to create a poller that monitors an existing operation.

update({ abortSignal?: AbortSignalLike, fireProgress?: (state: TState) => void })

Defines how to request the remote service for updates on the status of the long running operation.

It optionally receives an object with an abortSignal property, from @azure/abort-controller's AbortSignalLike. Also optionally receives a "fireProgress" function, which, if called, is responsible for triggering the poller's onProgress callbacks.

Property Details

state

The state of the operation. It will be used to store the basic properties of PollOperationState, plus any custom property that the implementation may require.

state: TState

Property Value

TState

Method Details

cancel({ abortSignal?: AbortSignalLike })

Warning

This API is now deprecated.

cancel has been deprecated because it was not implemented.

Attempts to cancel the underlying operation.

It only optionally receives an object with an abortSignal property, from @azure/abort-controller's AbortSignalLike.

It returns a promise that should be resolved with an updated version of the poller's operation.

function cancel(options?: { abortSignal?: AbortSignalLike }): Promise<PollOperation<TState, TResult>>

Parameters

options

{ abortSignal?: AbortSignalLike }

Optional properties passed to the operation's update method.

Returns

Promise<PollOperation<TState, TResult>>

toString()

Serializes the operation. Useful when wanting to create a poller that monitors an existing operation.

function toString(): string

Returns

string

update({ abortSignal?: AbortSignalLike, fireProgress?: (state: TState) => void })

Defines how to request the remote service for updates on the status of the long running operation.

It optionally receives an object with an abortSignal property, from @azure/abort-controller's AbortSignalLike. Also optionally receives a "fireProgress" function, which, if called, is responsible for triggering the poller's onProgress callbacks.

function update(options?: { abortSignal?: AbortSignalLike, fireProgress?: (state: TState) => void }): Promise<PollOperation<TState, TResult>>

Parameters

options

{ abortSignal?: AbortSignalLike, fireProgress?: (state: TState) => void }

Optional properties passed to the operation's update method.

Returns

Promise<PollOperation<TState, TResult>>