proxygen
|
#include <Request.h>
Classes | |
struct | State |
Public Member Functions | |
void | setContextData (const RequestToken &val, std::unique_ptr< RequestData > data) |
void | setContextData (const std::string &val, std::unique_ptr< RequestData > data) |
bool | setContextDataIfAbsent (const RequestToken &val, std::unique_ptr< RequestData > data) |
bool | setContextDataIfAbsent (const std::string &val, std::unique_ptr< RequestData > data) |
void | clearContextData (const RequestToken &val) |
void | clearContextData (const std::string &val) |
bool | hasContextData (const RequestToken &val) const |
bool | hasContextData (const std::string &val) const |
RequestData * | getContextData (const RequestToken &val) |
const RequestData * | getContextData (const RequestToken &val) const |
RequestData * | getContextData (const std::string &val) |
const RequestData * | getContextData (const std::string &val) const |
void | onSet () |
void | onUnset () |
Static Public Member Functions | |
static void | create () |
static RequestContext * | get () |
static std::shared_ptr< RequestContext > | setContext (std::shared_ptr< RequestContext > ctx) |
static std::shared_ptr< RequestContext > | saveContext () |
Private Types | |
enum | DoSetBehaviour { DoSetBehaviour::SET, DoSetBehaviour::SET_IF_ABSENT, DoSetBehaviour::OVERWRITE } |
Private Member Functions | |
void | overwriteContextData (const RequestToken &val, std::unique_ptr< RequestData > data) |
void | overwriteContextData (const std::string &val, std::unique_ptr< RequestData > data) |
bool | doSetContextData (const RequestToken &val, std::unique_ptr< RequestData > &data, DoSetBehaviour behaviour) |
bool | doSetContextData (const std::string &val, std::unique_ptr< RequestData > &data, DoSetBehaviour behaviour) |
Static Private Member Functions | |
static std::shared_ptr< RequestContext > & | getStaticContext () |
static std::shared_ptr< RequestContext > | setShallowCopyContext () |
Private Attributes | |
folly::Synchronized< State > | state_ |
Friends | |
struct | ShallowCopyRequestContextScopeGuard |
|
strongprivate |
void folly::RequestContext::clearContextData | ( | const RequestToken & | val | ) |
Definition at line 176 of file Request.cpp.
References folly::data(), folly::gen::move, folly::ulock(), and folly::wlock().
Referenced by TEST_F().
|
inline |
Definition at line 158 of file Request.h.
References folly::RequestToken::RequestToken().
|
inlinestatic |
Definition at line 118 of file Request.h.
References folly::data(), and val.
Referenced by folly::RequestContextScopeGuard::RequestContextScopeGuard(), and TEST_F().
|
private |
Definition at line 87 of file Request.cpp.
References folly::RequestData::constructPtr(), folly::RequestToken::getDebugString(), folly::ulock(), val, folly::WARNING, and folly::wlock().
|
inlineprivate |
Definition at line 233 of file Request.h.
References folly::RequestToken::RequestToken().
|
static |
Definition at line 290 of file Request.cpp.
References context.
Referenced by folly::RequestEventBase::get(), RequestContextTest::getContext(), folly::RequestEventBase::set(), folly::ShallowCopyRequestContextScopeGuard::ShallowCopyRequestContextScopeGuard(), TEST(), and TEST_F().
RequestData * folly::RequestContext::getContextData | ( | const RequestToken & | val | ) |
Definition at line 151 of file Request.cpp.
References folly::get_ref_default(), and val.
Referenced by folly::RequestEventBase::get(), TEST(), and TEST_F().
const RequestData * folly::RequestContext::getContextData | ( | const RequestToken & | val | ) | const |
Definition at line 156 of file Request.cpp.
References folly::get_ref_default(), and val.
|
inline |
Definition at line 173 of file Request.h.
References folly::RequestToken::RequestToken().
|
inline |
Definition at line 176 of file Request.h.
References folly::RequestToken::RequestToken().
|
staticprivate |
Definition at line 263 of file Request.cpp.
References folly::pushmi::operators::get.
bool folly::RequestContext::hasContextData | ( | const RequestToken & | val | ) | const |
Definition at line 147 of file Request.cpp.
|
inline |
Definition at line 165 of file Request.h.
References folly::RequestToken::RequestToken().
void folly::RequestContext::onSet | ( | ) |
Definition at line 162 of file Request.cpp.
References folly::data(), and folly::rlock().
void folly::RequestContext::onUnset | ( | ) |
Definition at line 169 of file Request.cpp.
References folly::data(), and folly::rlock().
|
private |
Definition at line 141 of file Request.cpp.
Referenced by folly::ShallowCopyRequestContextScopeGuard::ShallowCopyRequestContextScopeGuard().
|
inlineprivate |
Definition at line 216 of file Request.h.
References folly::gen::move, and folly::RequestToken::RequestToken().
|
inlinestatic |
Definition at line 196 of file Request.h.
Referenced by folly::fibers::FiberManager::initLocalData(), folly::fibers::FiberManager::loopUntilNoReadyImpl(), folly::NotificationQueue< folly::AsyncServerSocket::QueueMessage >::putMessageImpl(), folly::NotificationQueue< folly::AsyncServerSocket::QueueMessage >::putMessagesImpl(), folly::EventBase::runInLoop(), folly::fibers::FiberManager::runReadyFiber(), folly::AsyncTimeout::scheduleTimeout(), proxygen::AsyncTimeoutSet::scheduleTimeout(), folly::HHWheelTimer::scheduleTimeout(), folly::futures::detail::FutureBase< T >::setCallback_(), folly::TEST(), TEST(), and TEST_F().
|
static |
Definition at line 227 of file Request.cpp.
References folly::acquireLocked(), folly::as_const(), folly::data(), FOLLY_SDT, folly::RequestData::onSet(), and folly::RequestData::onUnset().
Referenced by folly::fibers::FiberManager::loopUntilNoReadyImpl(), folly::fibers::FiberManager::runReadyFiber(), RequestContextTest::SetUp(), TEST(), TEST_F(), proxygen::AsyncTimeoutSet::timeoutExpired(), folly::NotificationQueue< folly::AsyncServerSocket::QueueMessage >::tryConsume(), folly::RequestContextScopeGuard::~RequestContextScopeGuard(), and folly::ShallowCopyRequestContextScopeGuard::~ShallowCopyRequestContextScopeGuard().
void folly::RequestContext::setContextData | ( | const RequestToken & | val, |
std::unique_ptr< RequestData > | data | ||
) |
Definition at line 129 of file Request.cpp.
Referenced by folly::RequestEventBase::set(), TEST(), and TEST_F().
|
inline |
Definition at line 138 of file Request.h.
References folly::gen::move, and folly::RequestToken::RequestToken().
bool folly::RequestContext::setContextDataIfAbsent | ( | const RequestToken & | val, |
std::unique_ptr< RequestData > | data | ||
) |
Definition at line 135 of file Request.cpp.
|
inline |
Definition at line 150 of file Request.h.
References folly::gen::move, and folly::RequestToken::RequestToken().
|
staticprivate |
Definition at line 269 of file Request.cpp.
References folly::acquireLocked(), folly::as_const(), child, folly::RequestData::constructPtr(), parent, and folly::f14::swap().
|
friend |
|
private |