Interface QueryBusConnector.UpdateCallback
- Enclosing interface:
QueryBusConnector
public static interface QueryBusConnector.UpdateCallback
Defines a callback mechanism to handle update messages for subscription queries
in a reactive and asynchronous manner.
The
UpdateCallback interface is used to send update, complete the processing,
or handle exceptional completion during subscription queries.-
Method Summary
Modifier and TypeMethodDescriptioncomplete()Completes the processing of a subscription query gracefully.completeExceptionally(Throwable cause) Completes the processing of a subscription query exceptionally.Sends a subscription query update message asynchronously.
-
Method Details
-
sendUpdate
Sends a subscription query update message asynchronously. This method handles the delivery of incremental update to listeners in the context of a subscription query.- Parameters:
update- TheSubscriptionQueryUpdateMessagecontaining the update data to be sent as part of the subscription query.- Returns:
- A
CompletableFuturethat completes when the update has been successfully handled. If the update cannot be processed, the returned future will complete exceptionally.
-
complete
CompletableFuture<Void> complete()Completes the processing of a subscription query gracefully. This method signals that no further update will be sent as part of the subscription query and completes any associated operations.- Returns:
- A
CompletableFuturethat completes when the process has been finalized successfully. If the completion encounters an issue, the returned future will complete exceptionally.
-
completeExceptionally
Completes the processing of a subscription query exceptionally. This method signals that an error has occurred during the processing of the subscription query and terminates the operation with the provided exception.- Parameters:
cause- TheThrowablerepresenting the exceptional condition that caused the subscription query to terminate.- Returns:
- A
CompletableFuturethat completes exceptionally with the provided cause.
-