Package com.azure.core.util.polling
Class AsyncPollResponse<T,U>
- 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> extends Object
AsyncPollResponse represents an event emitted by thePollerFlux
that asynchronously polls a long-running operation (LRO). An AsyncPollResponse event provides information such as the currentstatus
of the LRO, anyvalue
returned in the poll, as well as other useful information provided by the service. AsyncPollResponse also exposescancelOperation()
method to cancel the long-running operation from reactor operator chain andgetFinalResult()
method that returns final result of the long-running operation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<T>
cancelOperation()
Mono<U>
getFinalResult()
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.
-
-
-
Method Detail
-
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.
-
cancelOperation
public Mono<T> cancelOperation()
- Returns:
- a Mono, upon subscription it cancels the remote long-running operation if cancellation is supported by the service.
-
-