Interface ReactorConnectionOperations<C>
- Type Parameters:
C- The connection
- All Superinterfaces:
ReactiveStreamsConnectionOperations<C>
- All Known Implementing Classes:
AbstractReactorConnectionOperations,DefaultR2dbcReactorConnectionOperations
Special version of
ReactiveStreamsConnectionOperations that is exposing Reactor publishers.- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionfindConnectionStatus(@NonNull reactor.util.context.ContextView contextView) Obtains the current connection.default @NonNull ConnectionStatus<C>getConnectionStatus(@NonNull reactor.util.context.ContextView contextView) Obtains the current required connection.default <T> @NonNull org.reactivestreams.Publisher<T>withConnection(@NonNull ConnectionDefinition definition, @NonNull Function<ConnectionStatus<C>, org.reactivestreams.Publisher<T>> handler) Execute the given handler with a new connection.default <T> @NonNull reactor.core.publisher.Flux<T>withConnectionFlux(@NonNull ConnectionDefinition definition, @NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Flux<T>> handler) Execute the given handler with a new transaction.default <T> @NonNull reactor.core.publisher.Flux<T>withConnectionFlux(@NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Flux<T>> handler) Execute the given handler with a new connection.default <T> @NonNull reactor.core.publisher.Mono<T>withConnectionMono(@NonNull ConnectionDefinition definition, @NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Mono<T>> handler) Execute the given handler with a new connection.default <T> reactor.core.publisher.Mono<T>withConnectionMono(@NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Mono<T>> handler) Execute the given handler with a new connection.Methods inherited from interface io.micronaut.data.connection.reactive.ReactiveStreamsConnectionOperations
withConnection
-
Method Details
-
getConnectionStatus
@NonNull default @NonNull ConnectionStatus<C> getConnectionStatus(@NonNull @NonNull reactor.util.context.ContextView contextView) Obtains the current required connection.- Parameters:
contextView- The reactor's context view- Returns:
- The connection or exception if the connection doesn't exist
-
findConnectionStatus
Optional<ConnectionStatus<C>> findConnectionStatus(@NonNull @NonNull reactor.util.context.ContextView contextView) Obtains the current connection.- Parameters:
contextView- The reactor's context view- Returns:
- The optional connection
-
withConnectionFlux
@NonNull default <T> @NonNull reactor.core.publisher.Flux<T> withConnectionFlux(@NonNull @NonNull ConnectionDefinition definition, @NonNull @NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Flux<T>> handler) Execute the given handler with a new transaction.- Type Parameters:
T- The emitted type- Parameters:
definition- The definitionhandler- The handler- Returns:
- A publisher that emits the result type
-
withConnectionFlux
@NonNull default <T> @NonNull reactor.core.publisher.Flux<T> withConnectionFlux(@NonNull @NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Flux<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
-
withConnectionMono
@NonNull default <T> @NonNull reactor.core.publisher.Mono<T> withConnectionMono(@NonNull @NonNull ConnectionDefinition definition, @NonNull @NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Mono<T>> handler) Execute the given handler with a new connection.- Type Parameters:
T- The emitted type- Parameters:
definition- The definitionhandler- The handler- Returns:
- A publisher that emits the result type
-
withConnectionMono
default <T> reactor.core.publisher.Mono<T> withConnectionMono(@NonNull @NonNull Function<ConnectionStatus<C>, reactor.core.publisher.Mono<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
-
withConnection
@NonNull default <T> @NonNull org.reactivestreams.Publisher<T> withConnection(@NonNull @NonNull ConnectionDefinition definition, @NonNull @NonNull Function<ConnectionStatus<C>, org.reactivestreams.Publisher<T>> handler) Description copied from interface:ReactiveStreamsConnectionOperationsExecute the given handler with a new connection.- Specified by:
withConnectionin interfaceReactiveStreamsConnectionOperations<C>- Type Parameters:
T- The emitted type- Parameters:
definition- The definitionhandler- The handler- Returns:
- A publisher that emits the result type
-