AsyncPollResponse<T,U> Class

  • java.lang.Object
    • com.azure.core.util.polling.AsyncPollResponse<T,U>

Type Parameters

T

The type of poll response value.

U

The type of the final result of long-running operation.

public final class AsyncPollResponse<T,U>

AsyncPollResponse represents an event emitted by the PollerFlux<T,U> that asynchronously polls a long-running operation (LRO). An AsyncPollResponse event provides information such as the current LongRunningOperationStatus of the LRO, any value returned by the poll, as well as other useful information provided by the service. AsyncPollResponse also exposes #cancelOperation method to cancel the long-running operation from reactor operator chain and getFinalResult() method that returns final result of the long-running operation.

Method Summary

Modifier and Type Method and Description
Mono<T> cancelOperation()

Gets a Mono whereupon subscription it cancels the remote long-running operation if cancellation is supported by the service.

Mono<U> getFinalResult()

Gets a Mono whereupon subscription it fetches the final result of the long-running operation if it is supported by the service.

LongRunningOperationStatus getStatus()

Represents the status of the long-running operation at the time the last polling operation finished successfully.

T getValue()

The value returned as a result of the last successful poll operation.

Methods inherited from java.lang.Object

Method Details

cancelOperation

public Mono cancelOperation()

Gets a Mono whereupon subscription it cancels the remote long-running operation if cancellation is supported by the service.

Returns:

A Mono whereupon subscription it cancels the remote long-running operation if cancellation is supported by the service.

getFinalResult

public Mono getFinalResult()

Gets a Mono whereupon subscription it fetches the final result of the long-running operation if it is supported by the service.

If the long-running operation isn't complete an empty Mono will be returned.

Returns:

A Mono whereupon subscription it fetches the final result of the long-running operation if it is supported by the service. If the long-running operation is not completed, then an empty Mono will be returned.

getStatus

public LongRunningOperationStatus getStatus()

Represents the status of the long-running operation at the time the last polling operation finished successfully.

Returns:

A LongRunningOperationStatus representing the result of the poll operation.

getValue

public T getValue()

The value returned as a result of the last successful poll operation. This can be any custom user defined object, or null if no value was returned from the service.

Returns:

T result of poll operation.

Applies to