Class ReactorContext
java.lang.Object
dmx.fun.reactor.ReactorContext
Bridges Reactor's
ContextView with dmx-fun's Option, so reading a
key that may be absent yields an Option instead of throwing.
Reactor's ContextView.get(Object) throws when a key is missing; this
helper models the absence explicitly as Option.none(). It introduces no
hidden global state — the ContextView is always passed in by the caller
(typically obtained from Mono.deferContextual).
ContextView was introduced in Reactor 3.4; these helpers therefore
require Reactor 3.4 or later, even though the ReactorFun conversions work
on earlier 3.x releases.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Option<T> Readskeyfrom a ReactorContextViewas anOption:Option.some(Object)when present,Option.none()when absent.
-
Method Details
-
getOrNone
Readskeyfrom a ReactorContextViewas anOption:Option.some(Object)when present,Option.none()when absent.- Type Parameters:
T- the value type stored under the key- Parameters:
context- the Reactor context view to read fromkey- the context key- Returns:
- the value as an
Option
-