Class DefaultSubscriptionQueryResult<I,U>

java.lang.Object
org.axonframework.queryhandling.DefaultSubscriptionQueryResult<I,U>
Type Parameters:
I - The type of initial result
U - The type of incremental updates
All Implemented Interfaces:
AutoCloseable, Registration, SubscriptionQueryResult<I,U>

public class DefaultSubscriptionQueryResult<I,U> extends Object implements SubscriptionQueryResult<I,U>
Default implementation of SubscriptionQueryResult.
Since:
3.3
Author:
Milan Savic
  • Constructor Details

    • DefaultSubscriptionQueryResult

      public DefaultSubscriptionQueryResult(reactor.core.publisher.Mono<I> initialResult, reactor.core.publisher.Flux<U> updates, Registration registrationDelegate)
      Initializes the result with mono and flux used for result retrieval.
      Parameters:
      initialResult - mono representing initial result
      updates - flux representing incremental updates
      registrationDelegate - delegate which cancels the registration of this result
  • Method Details

    • initialResult

      public reactor.core.publisher.Mono<I> initialResult()
      Description copied from interface: SubscriptionQueryResult
      Subscribing to this mono will trigger invocation of query handler. The return value of that query handler will be passed to the mono, once it's ready.
      Specified by:
      initialResult in interface SubscriptionQueryResult<I,U>
      Returns:
      the mono representing the initial result
    • updates

      public reactor.core.publisher.Flux<U> updates()
      Description copied from interface: SubscriptionQueryResult
      When there is an update to the subscription query, it will be emitted to this flux.
      Specified by:
      updates in interface SubscriptionQueryResult<I,U>
      Returns:
      the flux representing the incremental updates
    • cancel

      public boolean cancel()
      Description copied from interface: Registration
      Cancels this Registration. If the Registration was already cancelled, no action is taken.
      Specified by:
      cancel in interface Registration
      Returns:
      true if this handler is successfully deregistered, false if this handler was not currently registered.