PollerLike interface

A poller for an operation.

Extends

Promise<TResult>

Properties

isDone

Is true if the poller has finished polling.

operationState

The state of the operation. It can be undefined if the poller has not been submitted yet.

result

The result value of the operation, regardless of the state of the poller. It can be undefined or an incomplete form of the final TResult value depending on the implementation.

Inherited Properties

[toStringTag]

Methods

onProgress((state: TState) => void)

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.

poll({ abortSignal?: AbortSignalLike })

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.

pollUntilDone({ abortSignal?: AbortSignalLike })

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

serialize()

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

submitted()

Returns a promise that could be used to check if the poller has been submitted.

Inherited Methods

catch<TResult>(null | (reason: any) => TResult | PromiseLike<TResult>)

Attaches a callback for only the rejection of the Promise.

finally(null | () => void)

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

then<TResult1, TResult2>(null | (value: TResult) => TResult1 | PromiseLike<TResult1>, null | (reason: any) => TResult2 | PromiseLike<TResult2>)

Attaches callbacks for the resolution and/or rejection of the Promise.

Property Details

isDone

Is true if the poller has finished polling.

isDone: boolean

Property Value

boolean

operationState

The state of the operation. It can be undefined if the poller has not been submitted yet.

operationState: undefined | TState

Property Value

undefined | TState

result

The result value of the operation, regardless of the state of the poller. It can be undefined or an incomplete form of the final TResult value depending on the implementation.

result: undefined | TResult

Property Value

undefined | TResult

Inherited Property Details

[toStringTag]

[toStringTag]: string

Property Value

string

Inherited From Promise.__@toStringTag@68

Method Details

onProgress((state: TState) => void)

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.

function onProgress(callback: (state: TState) => void): CancelOnProgress

Parameters

callback

(state: TState) => void

Returns

poll({ abortSignal?: AbortSignalLike })

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.

function poll(options?: { abortSignal?: AbortSignalLike }): Promise<TState>

Parameters

options

{ abortSignal?: AbortSignalLike }

Returns

Promise<TState>

pollUntilDone({ abortSignal?: AbortSignalLike })

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

function pollUntilDone(pollOptions?: { abortSignal?: AbortSignalLike }): Promise<TResult>

Parameters

pollOptions

{ abortSignal?: AbortSignalLike }

Returns

Promise<TResult>

serialize()

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

function serialize(): Promise<string>

Returns

Promise<string>

submitted()

Returns a promise that could be used to check if the poller has been submitted.

function submitted(): Promise<void>

Returns

Promise<void>

Inherited Method Details

catch<TResult>(null | (reason: any) => TResult | PromiseLike<TResult>)

Attaches a callback for only the rejection of the Promise.

function catch<TResult>(onrejected?: null | (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult | TResult>

Parameters

onrejected

null | (reason: any) => TResult | PromiseLike<TResult>

The callback to execute when the Promise is rejected.

Returns

Promise<TResult | TResult>

A Promise for the completion of the callback.

Inherited From Promise.catch

finally(null | () => void)

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

function finally(onfinally?: null | () => void): Promise<TResult>

Parameters

onfinally

null | () => void

The callback to execute when the Promise is settled (fulfilled or rejected).

Returns

Promise<TResult>

A Promise for the completion of the callback.

Inherited From Promise.finally

then<TResult1, TResult2>(null | (value: TResult) => TResult1 | PromiseLike<TResult1>, null | (reason: any) => TResult2 | PromiseLike<TResult2>)

Attaches callbacks for the resolution and/or rejection of the Promise.

function then<TResult1, TResult2>(onfulfilled?: null | (value: TResult) => TResult1 | PromiseLike<TResult1>, onrejected?: null | (reason: any) => TResult2 | PromiseLike<TResult2>): Promise<TResult1 | TResult2>

Parameters

onfulfilled

null | (value: TResult) => TResult1 | PromiseLike<TResult1>

The callback to execute when the Promise is resolved.

onrejected

null | (reason: any) => TResult2 | PromiseLike<TResult2>

The callback to execute when the Promise is rejected.

Returns

Promise<TResult1 | TResult2>

A Promise for the completion of which ever callback is executed.

Inherited From Promise.then