Class DefaultR2dbcReactorConnectionOperations
java.lang.Object
io.micronaut.data.connection.support.AbstractReactorConnectionOperations<io.r2dbc.spi.Connection>
io.micronaut.data.r2dbc.connection.DefaultR2dbcReactorConnectionOperations
- All Implemented Interfaces:
ReactiveStreamsConnectionOperations<io.r2dbc.spi.Connection>
,ReactorConnectionOperations<io.r2dbc.spi.Connection>
@EachBean(io.r2dbc.spi.ConnectionFactory.class)
@Internal
public final class DefaultR2dbcReactorConnectionOperations
extends AbstractReactorConnectionOperations<io.r2dbc.spi.Connection>
The reactive R2DBC connection operations implementation.
- Since:
- 3.3
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.reactivestreams.Publisher<Void>
closeConnection
(io.r2dbc.spi.Connection connection, ConnectionDefinition definition) Close the connection.protected org.reactivestreams.Publisher<io.r2dbc.spi.Connection>
openConnection
(ConnectionDefinition definition) Open a new connection.<T> org.reactivestreams.Publisher<T>
withConnection
(ConnectionDefinition definition, Function<ConnectionStatus<io.r2dbc.spi.Connection>, org.reactivestreams.Publisher<T>> handler) Execute the given handler with a new connection.<T> reactor.core.publisher.Flux<T>
withConnectionFlux
(ConnectionDefinition definition, Function<ConnectionStatus<io.r2dbc.spi.Connection>, reactor.core.publisher.Flux<T>> handler) Execute the given handler with a new transaction.<T> reactor.core.publisher.Mono<T>
withConnectionMono
(ConnectionDefinition definition, Function<ConnectionStatus<io.r2dbc.spi.Connection>, reactor.core.publisher.Mono<T>> handler) Execute the given handler with a new connection.Methods inherited from class io.micronaut.data.connection.support.AbstractReactorConnectionOperations
findConnectionStatus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.data.connection.reactive.ReactiveStreamsConnectionOperations
withConnection
Methods inherited from interface io.micronaut.data.connection.reactive.ReactorConnectionOperations
getConnectionStatus, withConnectionFlux, withConnectionMono
-
Method Details
-
openConnection
protected org.reactivestreams.Publisher<io.r2dbc.spi.Connection> openConnection(ConnectionDefinition definition) Description copied from class:AbstractReactorConnectionOperations
Open a new connection.- Specified by:
openConnection
in classAbstractReactorConnectionOperations<io.r2dbc.spi.Connection>
- Parameters:
definition
- The connection definition- Returns:
- new connection publisher
-
closeConnection
protected org.reactivestreams.Publisher<Void> closeConnection(io.r2dbc.spi.Connection connection, ConnectionDefinition definition) Description copied from class:AbstractReactorConnectionOperations
Close the connection.- Specified by:
closeConnection
in classAbstractReactorConnectionOperations<io.r2dbc.spi.Connection>
- Parameters:
connection
- The connectiondefinition
- The connection definition- Returns:
- closed publisher
-
withConnection
public <T> org.reactivestreams.Publisher<T> withConnection(ConnectionDefinition definition, Function<ConnectionStatus<io.r2dbc.spi.Connection>, org.reactivestreams.Publisher<T>> handler) Description copied from interface:ReactiveStreamsConnectionOperations
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
-
withConnectionFlux
public <T> reactor.core.publisher.Flux<T> withConnectionFlux(ConnectionDefinition definition, Function<ConnectionStatus<io.r2dbc.spi.Connection>, reactor.core.publisher.Flux<T>> handler) Description copied from interface:ReactorConnectionOperations
Execute the given handler with a new transaction.- Specified by:
withConnectionFlux
in interfaceReactorConnectionOperations<io.r2dbc.spi.Connection>
- Overrides:
withConnectionFlux
in classAbstractReactorConnectionOperations<io.r2dbc.spi.Connection>
- Type Parameters:
T
- The emitted type- Parameters:
definition
- The definitionhandler
- The handler- Returns:
- A publisher that emits the result type
-
withConnectionMono
public <T> reactor.core.publisher.Mono<T> withConnectionMono(ConnectionDefinition definition, Function<ConnectionStatus<io.r2dbc.spi.Connection>, reactor.core.publisher.Mono<T>> handler) Description copied from interface:ReactorConnectionOperations
Execute the given handler with a new connection.- Specified by:
withConnectionMono
in interfaceReactorConnectionOperations<io.r2dbc.spi.Connection>
- Overrides:
withConnectionMono
in classAbstractReactorConnectionOperations<io.r2dbc.spi.Connection>
- Type Parameters:
T
- The emitted type- Parameters:
definition
- The definitionhandler
- The handler- Returns:
- A publisher that emits the result type
-