Interface AsyncConnectionOperations<C>

Type Parameters:
C - The connection type
All Known Implementing Classes:
AsyncUsingReactiveConnectionOperations

public interface AsyncConnectionOperations<C>
An interface for async connection manager.
Since:
4.0.0
Author:
Denis Stepanov
  • Method Details

    • getConnectionStatus

      @NonNull default @NonNull ConnectionStatus<C> getConnectionStatus()
      Obtains the current required connection.
      Returns:
      The connection or exception if the connection doesn't exist
    • findConnectionStatus

      Optional<ConnectionStatus<C>> findConnectionStatus()
      Obtains the current connection.
      Returns:
      The optional connection
    • withConnection

      @NonNull <T> @NonNull CompletionStage<T> withConnection(@NonNull @NonNull ConnectionDefinition definition, @NonNull @NonNull Function<ConnectionStatus<C>,CompletionStage<T>> handler)
      Execute the given handler with a new connection.
      Type Parameters:
      T - The emitted type
      Parameters:
      definition - The definition
      handler - The handler
      Returns:
      A publisher that emits the result type
    • withConnection

      @NonNull default <T> @NonNull CompletionStage<T> withConnection(@NonNull @NonNull Function<ConnectionStatus<C>,CompletionStage<T>> handler)
      Execute the given handler with a new connection.
      Type Parameters:
      T - The emitted type
      Parameters:
      handler - The handler
      Returns:
      A publisher that emits the result type