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> Flux<T> execute(ReactiveSessionCallback<T> action) Executes the givenReactiveSessionCallbackwithin theClientSession.<T> Flux<T> execute(ReactiveSessionCallback<T> action, Consumer<com.mongodb.reactivestreams.client.ClientSession> doFinally) Executes the givenReactiveSessionCallbackwithin theClientSession.
-
Method Details
-
execute
Executes the givenReactiveSessionCallbackwithin theClientSession.
It is up to the caller to make sure theClientSessionisclosedwhen 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> Flux<T> execute(ReactiveSessionCallback<T> action, Consumer<com.mongodb.reactivestreams.client.ClientSession> doFinally) Executes the givenReactiveSessionCallbackwithin theClientSession.
It is up to the caller to make sure theClientSessionisclosedwhen 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 acceptsClientSessionafter invokingReactiveSessionCallback. ThisConsumeris guaranteed to be notified in any case (successful and exceptional outcome ofReactiveSessionCallback).- Returns:
- a result object returned by the action, can be
Flux.empty().
-