1 #ifndef MY_NCBI_CACHE__HPP
2 #define MY_NCBI_CACHE__HPP
64 m_Status(ePSGS_InProgress)
84 void x_OnSuccess(
const string & cookie,
88 void x_OnNotFound(
const string & cookie);
111 m_App(app), m_HighMark(high_mark), m_LowMark(low_mark)
119 const string & cookie,
122 void AddUserInfo(
const string & cookie,
126 void OnNotFound(
const string & cookie);
128 void ClearWaitingProcessor(
const string & cookie,
130 void ClearInitiatedRequest(
const string & cookie);
135 lock_guard<mutex> guard(m_Lock);
137 size = m_Cache.size();
161 size_t high_mark,
size_t low_mark,
162 size_t expiration_sec) :
163 m_App(app), m_HighMark(high_mark), m_LowMark(low_mark),
164 m_ExpirationMs(expiration_sec * 1000)
171 bool IsNotFound(
const string & cookie);
172 void AddNotFound(
const string & cookie);
177 lock_guard<mutex> guard(m_Lock);
179 size = m_Cache.size();
204 EDiagSev severity,
const string & message) :
206 m_Status(status), m_Code(
code), m_Severity(severity), m_Message(message)
230 size_t high_mark,
size_t low_mark,
231 size_t back_off_ms) :
232 m_App(app), m_HighMark(high_mark), m_LowMark(low_mark),
233 m_BackOffMs(back_off_ms)
240 optional<SMyNCBIErrorCacheItem> GetError(
const string & cookie);
247 lock_guard<mutex> guard(m_Lock);
249 size = m_Cache.size();
CMyNCBIErrorCache(CPubseqGatewayApp *app, size_t high_mark, size_t low_mark, size_t back_off_ms)
CPubseqGatewayApp * m_App
map< string, SMyNCBIErrorCacheItem > m_Cache
CPubseqGatewayApp * m_App
CMyNCBINotFoundCache(CPubseqGatewayApp *app, size_t high_mark, size_t low_mark, size_t expiration_sec)
map< string, psg_time_point_t > m_Cache
CMyNCBIOKCache(CPubseqGatewayApp *app, size_t high_mark, size_t low_mark)
CPubseqGatewayApp * m_App
map< string, SMyNCBIOKCacheItem > m_Cache
Interface class (and self-factory) for request processor objects that can retrieve data from a given ...
EDiagSev
Severity level for the posted diagnostics.
function< void(const string &cookie, CPSG_MyNCBIRequest_WhoAmI::SUserInfo info)> TMyNCBIDataCB
function< void(const string &cookie, CRequestStatus::ECode status, int code, EDiagSev severity, const string &message)> TMyNCBIErrorCB
const struct ncbi::grid::netcache::search::fields::SIZE size
chrono::steady_clock psg_clock_t
psg_clock_t::time_point psg_time_point_t
CPSG_MyNCBIRequest_WhoAmI::SUserInfo m_UserInfo
SMyNCBIOKCacheItem::EPSGS_MyNCBIResolutionStatus m_Status
psg_time_point_t m_LastTouch
SMyNCBIErrorCacheItem(CRequestStatus::ECode status, int code, EDiagSev severity, const string &message)
CRequestStatus::ECode m_Status
IPSGS_Processor * m_Processor
EPSGS_MyNCBIResolutionStatus m_Status
EPSGS_MyNCBIResolutionStatus
CPSG_MyNCBIRequest_WhoAmI::SUserInfo m_UserInfo
void x_AddToWaitList(IPSGS_Processor *processor, TMyNCBIDataCB data_cb, TMyNCBIErrorCB error_cb)
psg_time_point_t m_LastTouch
list< SMyNCBIWaitListItem > m_WaitList