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 the PollerFlux that asynchronously polls a long-running operation (LRO). An AsyncPollResponse event provides information such as the current status 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 Details

    • 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.
    • getFinalResult

      public Mono<U> getFinalResult()
      Returns:
      a Mono, upon subscription it fetches the final result of 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.