proxygen
IdleTimeTimeoutSeries Class Reference
Inheritance diagram for IdleTimeTimeoutSeries:
folly::AsyncTimeout

Public Member Functions

 IdleTimeTimeoutSeries (EventBase *base, std::deque< std::size_t > &timeout)
 
 ~IdleTimeTimeoutSeries () override
 
void timeoutExpired () noexceptoverride
 
int getTimeouts () const
 
- 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 ()
 

Private Attributes

int timeouts_
 
std::deque< std::size_t > & timeout_
 

Additional Inherited Members

- Public Types inherited from folly::AsyncTimeout
typedef TimeoutManager::InternalEnum InternalEnum
 
- 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 1566 of file EventBaseTest.cpp.

Constructor & Destructor Documentation

IdleTimeTimeoutSeries::IdleTimeTimeoutSeries ( EventBase base,
std::deque< std::size_t > &  timeout 
)
inlineexplicit

Definition at line 1568 of file EventBaseTest.cpp.

1571  : AsyncTimeout(base), timeouts_(0), timeout_(timeout) {
1572  scheduleTimeout(1);
1573  }
std::deque< std::size_t > & timeout_
bool scheduleTimeout(uint32_t milliseconds)
IdleTimeTimeoutSeries::~IdleTimeTimeoutSeries ( )
inlineoverride

Definition at line 1575 of file EventBaseTest.cpp.

1575 {}

Member Function Documentation

int IdleTimeTimeoutSeries::getTimeouts ( ) const
inline

Definition at line 1592 of file EventBaseTest.cpp.

Referenced by TEST().

1592  {
1593  return timeouts_;
1594  }
void IdleTimeTimeoutSeries::timeoutExpired ( )
inlineoverridevirtualnoexcept

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

Implements folly::AsyncTimeout.

Definition at line 1577 of file EventBaseTest.cpp.

1577  {
1578  ++timeouts_;
1579 
1580  if (timeout_.empty()) {
1581  cancelTimeout();
1582  } else {
1583  std::size_t sleepTime = timeout_.front();
1584  timeout_.pop_front();
1585  if (sleepTime) {
1586  usleep(sleepTime);
1587  }
1588  scheduleTimeout(1);
1589  }
1590  }
std::deque< std::size_t > & timeout_
bool scheduleTimeout(uint32_t milliseconds)

Member Data Documentation

std::deque<std::size_t>& IdleTimeTimeoutSeries::timeout_
private

Definition at line 1598 of file EventBaseTest.cpp.

int IdleTimeTimeoutSeries::timeouts_
private

Definition at line 1597 of file EventBaseTest.cpp.


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