Package com.linecorp.armeria.common
Interface ContextAwareConsumer<T>
- All Superinterfaces:
Consumer<T>
,ContextHolder
A delegating
Consumer
that makes sure an underlying Consumer is
executed within the RequestContext
.-
Method Summary
Modifier and TypeMethodDescriptioncontext()
Returns theRequestContext
that was specified when creating thisContextAwareConsumer
.static <T> ContextAwareConsumer<T>
of
(RequestContext context, Consumer<T> action) Returns a newContextAwareConsumer
that sets the specifiedRequestContext
before executing an underlyingConsumer
.Returns theConsumer
that's executed without setting theRequestContext
.
-
Method Details
-
of
Returns a newContextAwareConsumer
that sets the specifiedRequestContext
before executing an underlyingConsumer
. -
context
RequestContext context()Returns theRequestContext
that was specified when creating thisContextAwareConsumer
.- Specified by:
context
in interfaceContextHolder
-
withoutContext
Returns theConsumer
that's executed without setting theRequestContext
.
-