Package com.linecorp.armeria.common
Interface ContextAwareFunction<T,R>
- All Superinterfaces:
ContextHolder
,Function<T,
R>
A delegating
Function
that makes sure an underlying Function is
executed within the RequestContext
.-
Method Summary
Modifier and TypeMethodDescriptioncontext()
Returns theRequestContext
that was specified when creating thisContextAwareFunction
.static <T,
R> ContextAwareFunction <T, R> of
(RequestContext context, Function<T, R> function) Returns a newContextAwareFuture
that sets the specifiedRequestContext
before executing an underlyingFunction
.Returns theFunction
that's executed without setting theRequestContext
.
-
Method Details
-
of
Returns a newContextAwareFuture
that sets the specifiedRequestContext
before executing an underlyingFunction
. -
context
RequestContext context()Returns theRequestContext
that was specified when creating thisContextAwareFunction
.- Specified by:
context
in interfaceContextHolder
-
withoutContext
Returns theFunction
that's executed without setting theRequestContext
.
-