Per-request context associated with an enqueued item.
Declared in <folly/io/async/Request.h>
class RequestContext;
| Name | Description |
|---|---|
RootIdInfo | Describes the root id associated with a thread. |
State | Internal state of a RequestContext. |
StaticContext | Thread-local holder of the current request context. |
StaticContextAccessor | Accessor that iterates the StaticContext of every thread. |
| Name | Description |
|---|---|
SetContextWatcherSig | Signature for watcher callbacks invoked after a setContext. |
| Name | Description |
|---|---|
DoSetBehaviour | Selects the behavior of doSetContextDataHelper. |
| Name | Description |
|---|---|
RequestContext [constructor] | Constructors |
operator= | Assignment operators |
clearContextData | clearContextData overloads |
doSetContextDataHelper | doSetContextDataHelper overloads |
getContextData | getContextData overloads |
getRootId | Returns the root id of this context. |
getThreadCachedContextData | Returns cached context data for the token, keyed by a type tag. |
hasContextData | hasContextData overloads |
onSet | Invokes the onSet() callbacks of all held RequestData instances. |
onUnset | Invokes the onUnset() callbacks of all held RequestData instances. |
overwriteContextData | overwriteContextData overloads |
setContextData | setContextData overloads |
setContextDataIfAbsent | setContextDataIfAbsent overloads |
| Name | Description |
|---|---|
accessAllThreads | Returns an accessor that pins the StaticContext of all threads. |
addSetContextWatcher | Registers a watcher invoked on every context change. |
copyAsChild | Copies a context as a child of the given one. |
copyAsRoot | Copies a context as a new root context. |
create | Creates a unique request context and sets it as the current context. |
get | Returns the current context, or the default global request context. |
getRootIdsFromAllThreads | Collects the root id information from all threads. |
saveContext | Returns a shared pointer to the current context. |
setContext | Sets the given context as current and returns the previous one. |
setShallowCopyContext | Sets a shallow copy of the current context as current. |
try_get | Returns the current context, if it has already been set, or nullptr. |
| Name | Description |
|---|---|
rootId_ | The root id; shallow copies keep a note of the root context. |
state_ | The internal state of this context. |
| Name | Description |
|---|---|
folly::ShallowCopyRequestContextScopeGuard | This guard maintains all the RequestData pointers of the parent. This allows to overwrite a specific RequestData pointer for the scope's duration, without breaking others. |