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 Details

    • sendUpdate

      @Nonnull CompletableFuture<Void> sendUpdate(@Nonnull SubscriptionQueryUpdateMessage update)
      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 - The SubscriptionQueryUpdateMessage containing the update data to be sent as part of the subscription query.
      Returns:
      A CompletableFuture that 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 CompletableFuture that completes when the process has been finalized successfully. If the completion encounters an issue, the returned future will complete exceptionally.
    • completeExceptionally

      CompletableFuture<Void> completeExceptionally(@Nonnull Throwable cause)
      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 - The Throwable representing the exceptional condition that caused the subscription query to terminate.
      Returns:
      A CompletableFuture that completes exceptionally with the provided cause.