Class 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 in 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 Detail

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