Package org.axonframework.queryhandling
Interface SubscriptionQueryResult<I,U>
- All Superinterfaces:
AutoCloseable,Registration
- All Known Implementing Classes:
AxonServerSubscriptionQueryResult,DefaultSubscriptionQueryResult,DeserializedResult,DisposableResult
Result of the subscription query. It contains publishers for initial result and incremental updates. Until there is a
subscription to the publisher, nothing happens.
- Since:
- 3.3
- Author:
- Milan Savic
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidDeprecated.default voidhandle(Consumer<? super I> initialResultConsumer, Consumer<? super U> updateConsumer, Consumer<Throwable> errorConsumer) Delegates handling of initial result and incremental updates to the provided consumers.reactor.core.publisher.Mono<I> Subscribing to this mono will trigger invocation of query handler.reactor.core.publisher.Flux<U> updates()When there is an update to the subscription query, it will be emitted to this flux.Methods inherited from interface org.axonframework.common.Registration
cancel, close
-
Field Details
-
logger
static final org.slf4j.Logger logger
-
-
Method Details
-
initialResult
reactor.core.publisher.Mono<I> initialResult()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.- Returns:
- the mono representing the initial result
-
updates
reactor.core.publisher.Flux<U> updates()When there is an update to the subscription query, it will be emitted to this flux.- Returns:
- the flux representing the incremental updates
-
handle
@Deprecated default void handle(Consumer<? super I> initialResultConsumer, Consumer<? super U> updateConsumer) Deprecated.Please usehandle(Consumer, Consumer, Consumer)instead, to consciously deal with any exceptions with theerrorConsumer.Delegates handling of initial result and incremental updates to the provided consumers.Subscription to the incremental updates is done after the initial result is retrieved and its consumer is invoked. If anything goes wrong during invoking or consuming initial result or incremental updates, subscription is cancelled.
-
handle
default void handle(Consumer<? super I> initialResultConsumer, Consumer<? super U> updateConsumer, Consumer<Throwable> errorConsumer) Delegates handling of initial result and incremental updates to the provided consumers.Subscription to the incremental updates is done after the initial result is retrieved and its consumer is invoked. If anything goes wrong during invoking or consuming initial result or incremental updates, subscription is cancelled after invoking the given
errorConsumer.- Parameters:
initialResultConsumer- TheConsumerto be invoked when the initial result is retrieved.updateConsumer- TheConsumerto be invoked when incremental updates are emitted.errorConsumer- AConsumerofExceptionused to react to an exception resulting from theinitialResult()orupdates().
-
handle(Consumer, Consumer, Consumer)instead, to consciously deal with any exceptions with theerrorConsumer.