Package io.smallrye.mutiny.subscription
Interface ContextSupport
-
- All Known Subinterfaces:
MultiEmitter<T>
,UniEmitter<T>
,UniSubscriber<T>
- All Known Implementing Classes:
AssertSubscriber
,SafeSubscriber
,SerializedSubscriber
,Subscribers.CallbackBasedSubscriber
,SwitchableSubscriptionSubscriber
,UniAssertSubscriber
,UniDelegatingSubscriber
,UniSerializedSubscriber
@Experimental("Context support is a new experimental API introduced in Mutiny 1.3.0") public interface ContextSupport
Interface for subscribers and types that provide aContext
.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Context
context()
Provide a context.
-
-
-
Method Detail
-
context
default Context context()
Provide a context.Since calls to this method shall only be triggered when a Mutiny pipeline uses a
withContext
operator, there is no need in general for caching the context value in a field of the implementing class. Exceptions include operators that have cross-subscriber semantics such as memoizers or broadcasters.This method is expected to be called once per
withContext
operator.- Returns:
- the context, must not be
null
.
-
-