proxygen
folly::TimeoutManager::CobTimeouts::CobTimeout Class Reference
Inheritance diagram for folly::TimeoutManager::CobTimeouts::CobTimeout:
folly::AsyncTimeout

Public Types

using ListHook = boost::intrusive::list_member_hook< boost::intrusive::link_mode< boost::intrusive::auto_unlink >>
 
using List = boost::intrusive::list< CobTimeout, boost::intrusive::member_hook< CobTimeout, ListHook,&CobTimeout::hook >, boost::intrusive::constant_time_size< false >>
 
- Public Types inherited from folly::AsyncTimeout
typedef TimeoutManager::InternalEnum InternalEnum
 

Public Member Functions

 CobTimeout (TimeoutManager *timeoutManager, Func cob, InternalEnum internal)
 
void timeoutExpired () noexceptoverride
 
- Public Member Functions inherited from folly::AsyncTimeout
 AsyncTimeout (TimeoutManager *timeoutManager)
 
 AsyncTimeout (EventBase *eventBase)
 
 AsyncTimeout (TimeoutManager *timeoutManager, InternalEnum internal)
 
 AsyncTimeout (EventBase *eventBase, InternalEnum internal)
 
 AsyncTimeout ()
 
virtual ~AsyncTimeout ()
 
bool scheduleTimeout (uint32_t milliseconds)
 
bool scheduleTimeout (TimeoutManager::timeout_type timeout)
 
void cancelTimeout ()
 
bool isScheduled () const
 
void attachTimeoutManager (TimeoutManager *timeoutManager, InternalEnum internal=InternalEnum::NORMAL)
 
void attachEventBase (EventBase *eventBase, InternalEnum internal=InternalEnum::NORMAL)
 
void detachTimeoutManager ()
 
void detachEventBase ()
 
const TimeoutManagergetTimeoutManager ()
 
struct event * getEvent ()
 

Public Attributes

ListHook hook
 

Private Attributes

Func cob_
 

Additional Inherited Members

- Static Public Member Functions inherited from folly::AsyncTimeout
template<typename TCallback >
static std::unique_ptr< AsyncTimeoutmake (TimeoutManager &manager, TCallback &&callback)
 
template<typename TCallback >
static std::unique_ptr< AsyncTimeoutschedule (TimeoutManager::timeout_type timeout, TimeoutManager &manager, TCallback &&callback)
 

Detailed Description

Definition at line 32 of file TimeoutManager.cpp.

Member Typedef Documentation

using folly::TimeoutManager::CobTimeouts::CobTimeout::List = boost::intrusive::list< CobTimeout, boost::intrusive::member_hook<CobTimeout, ListHook, &CobTimeout::hook>, boost::intrusive::constant_time_size<false>>

Definition at line 64 of file TimeoutManager.cpp.

using folly::TimeoutManager::CobTimeouts::CobTimeout::ListHook = boost::intrusive::list_member_hook< boost::intrusive::link_mode<boost::intrusive::auto_unlink>>

Definition at line 59 of file TimeoutManager.cpp.

Constructor & Destructor Documentation

folly::TimeoutManager::CobTimeouts::CobTimeout::CobTimeout ( TimeoutManager timeoutManager,
Func  cob,
InternalEnum  internal 
)
inline

Definition at line 34 of file TimeoutManager.cpp.

35  : AsyncTimeout(timeoutManager, internal), cob_(std::move(cob)) {}
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567

Member Function Documentation

void folly::TimeoutManager::CobTimeouts::CobTimeout::timeoutExpired ( )
inlineoverridevirtualnoexcept

timeoutExpired() is invoked when the timeout period has expired.

Implements folly::AsyncTimeout.

Definition at line 37 of file TimeoutManager.cpp.

References cob_, and name.

37  {
38  // For now, we just swallow any exceptions that the callback threw.
39  try {
40  cob_();
41  } catch (const std::exception& ex) {
42  LOG(ERROR) << "TimeoutManager::runAfterDelay() callback threw "
43  << typeid(ex).name() << " exception: " << ex.what();
44  } catch (...) {
45  LOG(ERROR) << "TimeoutManager::runAfterDelay() callback threw "
46  << "non-exception type";
47  }
48 
49  // The CobTimeout object was allocated on the heap by runAfterDelay(),
50  // so delete it now that the it has fired.
51  delete this;
52  }
const char * name
Definition: http_parser.c:437

Member Data Documentation

Func folly::TimeoutManager::CobTimeouts::CobTimeout::cob_
private

Definition at line 55 of file TimeoutManager.cpp.

Referenced by timeoutExpired().

ListHook folly::TimeoutManager::CobTimeouts::CobTimeout::hook

Definition at line 60 of file TimeoutManager.cpp.


The documentation for this class was generated from the following file: