Interface ReactiveSessionScoped
public interface ReactiveSessionScoped
Gateway interface to execute
ClientSession
bound operations against MongoDB via a
ReactiveSessionCallback
.- Since:
- 2.1
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> reactor.core.publisher.Flux<T>
execute
(ReactiveSessionCallback<T> action) Executes the givenReactiveSessionCallback
within theClientSession
.<T> reactor.core.publisher.Flux<T>
execute
(ReactiveSessionCallback<T> action, Consumer<com.mongodb.reactivestreams.client.ClientSession> doFinally) Executes the givenReactiveSessionCallback
within theClientSession
.
-
Method Details
-
execute
Executes the givenReactiveSessionCallback
within theClientSession
.
It is up to the caller to make sure theClientSession
isclosed
when done.- Type Parameters:
T
- return type.- Parameters:
action
- callback object that specifies the MongoDB action the callback action. Must not be null.- Returns:
- a result object returned by the action, can be
Flux.empty()
.
-
execute
<T> reactor.core.publisher.Flux<T> execute(ReactiveSessionCallback<T> action, Consumer<com.mongodb.reactivestreams.client.ClientSession> doFinally) Executes the givenReactiveSessionCallback
within theClientSession
.
It is up to the caller to make sure theClientSession
isclosed
when done.- Type Parameters:
T
- return type.- Parameters:
action
- callback object that specifies the MongoDB action the callback action. Must not be null.doFinally
- callback object that acceptsClientSession
after invokingReactiveSessionCallback
. ThisConsumer
is guaranteed to be notified in any case (successful and exceptional outcome ofReactiveSessionCallback
).- Returns:
- a result object returned by the action, can be
Flux.empty()
.
-