Package io.servicetalk.concurrent.api
Interface CapturedContext
public interface CapturedContext
A representation of a context state that can be attached to the current thread.
Instances represent captured context state which includes things like the
AsyncContext state and potentially
additional state if instances of CapturedContextProvider are found. This state can be attached to the current
thread via the attachContext() method which will return a Scope used to detach this
state, restoring any context information that existed beforehand.-
Method Summary
Modifier and TypeMethodDescriptionAttach the captured context to the thread state.captured()TheContextMapthat was captured.
-
Method Details
-
captured
ContextMap captured()TheContextMapthat was captured.- Returns:
ContextMapthat was captured.
-
attachContext
Scope attachContext()Attach the captured context to the thread state.- Returns:
- a
Scopethat will be used to restore the previous context associated with the current thread state when the scoped operation completes.
-