proxygen
|
#include <AsyncTimeoutSet.h>
Public Member Functions | |
Callback () | |
virtual | ~Callback () |
virtual void | timeoutExpired () noexcept=0 |
void | cancelTimeout () |
bool | isScheduled () const |
Private Member Functions | |
std::chrono::milliseconds | getTimeRemaining (std::chrono::milliseconds now) const |
void | setScheduled (AsyncTimeoutSet *timeoutSet, Callback *prev) |
void | cancelTimeoutImpl () |
Private Attributes | |
std::shared_ptr< folly::RequestContext > | context_ |
AsyncTimeoutSet * | timeoutSet_ {nullptr} |
Callback * | prev_ {nullptr} |
Callback * | next_ {nullptr} |
std::chrono::milliseconds | expiration_ {0} |
Friends | |
class | AsyncTimeoutSet |
A callback to be notified when a timeout has expired.
AsyncTimeoutSet::Callback is very similar to AsyncTimeout. The primary distinction is that AsyncTimeout can choose its timeout interval each time it is scheduled. On the other hand, AsyncTimeoutSet::Callback always uses the timeout interval defined by the AsyncTimeoutSet where it is scheduled.
Definition at line 54 of file AsyncTimeoutSet.h.
|
inline |
Definition at line 56 of file AsyncTimeoutSet.h.
References folly::pushmi::__adl::noexcept(), timeoutExpired(), and ~Callback().
|
virtual |
Definition at line 32 of file AsyncTimeoutSet.cpp.
Referenced by Callback().
|
inline |
Cancel the timeout, if it is running.
If the timeout is not scheduled, cancelTimeout() does nothing.
Definition at line 70 of file AsyncTimeoutSet.h.
References cancelTimeoutImpl(), and timeoutSet_.
Referenced by proxygen::AsyncTimeoutSet::scheduleTimeout(), TEST_F(), and proxygen::AsyncTimeoutSet::timeoutExpired().
|
private |
Definition at line 52 of file AsyncTimeoutSet.cpp.
References proxygen::AsyncTimeoutSet::AsyncTimeoutSet(), and proxygen::getTimeoutClock().
Referenced by cancelTimeout(), and getTimeRemaining().
|
inlineprivate |
Definition at line 87 of file AsyncTimeoutSet.h.
References cancelTimeoutImpl(), expiration_, now(), and setScheduled().
|
inline |
Return true if this timeout is currently scheduled, and false otherwise.
Definition at line 81 of file AsyncTimeoutSet.h.
References timeoutSet_.
|
private |
Definition at line 38 of file AsyncTimeoutSet.cpp.
References proxygen::AsyncTimeoutSet::TimeoutClock::millisecondsSinceEpoch(), proxygen::AsyncTimeoutSet::timeoutClock_, and proxygen::timePointInitialized().
Referenced by getTimeRemaining(), and proxygen::AsyncTimeoutSet::scheduleTimeout().
|
pure virtualnoexcept |
timeoutExpired() is invoked when the timeout has expired.
Implemented in TestTimeout, proxygen::AckTimeout, TestTimeout, TestTimeout, and TestTimeout.
Referenced by Callback(), proxygen::AsyncTimeoutSet::front(), and proxygen::AsyncTimeoutSet::timeoutExpired().
|
friend |
Definition at line 107 of file AsyncTimeoutSet.h.
Referenced by proxygen::AsyncTimeoutSet::front(), and proxygen::AsyncTimeoutSet::TimeoutClock::~TimeoutClock().
|
private |
Definition at line 98 of file AsyncTimeoutSet.h.
Referenced by proxygen::AsyncTimeoutSet::scheduleTimeout(), and proxygen::AsyncTimeoutSet::timeoutExpired().
|
private |
Definition at line 103 of file AsyncTimeoutSet.h.
Referenced by getTimeRemaining().
Definition at line 102 of file AsyncTimeoutSet.h.
Referenced by proxygen::AsyncTimeoutSet::scheduleTimeout().
Definition at line 101 of file AsyncTimeoutSet.h.
Referenced by proxygen::AsyncTimeoutSet::scheduleTimeout().
|
private |
Definition at line 100 of file AsyncTimeoutSet.h.
Referenced by cancelTimeout(), and isScheduled().