proxygen
folly::EventBase::FunctionRunner Class Reference
Inheritance diagram for folly::EventBase::FunctionRunner:
folly::NotificationQueue< MessageT >::Consumer folly::DelayedDestruction folly::EventHandler folly::DelayedDestructionBase

Public Member Functions

void messageAvailable (Func &&msg) noexceptoverride
 
- Public Member Functions inherited from folly::NotificationQueue< MessageT >::Consumer
 Consumer ()
 
virtual void messageAvailable (MessageT &&message) noexcept=0
 
void startConsuming (EventBase *eventBase, NotificationQueue *queue)
 
void startConsumingInternal (EventBase *eventBase, NotificationQueue *queue)
 
void stopConsuming ()
 
bool consumeUntilDrained (size_t *numConsumed=nullptr) noexcept
 
NotificationQueuegetCurrentQueue () const
 
void setMaxReadAtOnce (uint32_t maxAtOnce)
 
uint32_t getMaxReadAtOnce () const
 
EventBasegetEventBase ()
 
void handlerReady (uint16_t events) noexceptoverride
 
template<typename TCallback >
std::unique_ptr< typename NotificationQueue< MessageT >::Consumer, DelayedDestruction::Destructormake (TCallback &&callback)
 
- Public Member Functions inherited from folly::DelayedDestruction
bool getDestroyPending () const
 
- Public Member Functions inherited from folly::DelayedDestructionBase
virtual ~DelayedDestructionBase ()=default
 

Additional Inherited Members

- Public Types inherited from folly::NotificationQueue< MessageT >::Consumer
enum  : uint16_t { kDefaultMaxReadAtOnce = 10 }
 
- Static Public Member Functions inherited from folly::NotificationQueue< MessageT >::Consumer
template<typename TCallback >
static std::unique_ptr< Consumer, DelayedDestruction::Destructormake (TCallback &&callback)
 
- Protected Member Functions inherited from folly::NotificationQueue< MessageT >::Consumer
void destroy () override
 
 ~Consumer () override
 
- Protected Member Functions inherited from folly::DelayedDestruction
 ~DelayedDestruction () override=default
 
 DelayedDestruction ()
 
- Protected Member Functions inherited from folly::DelayedDestructionBase
 DelayedDestructionBase ()
 
uint32_t getDestructorGuardCount () const
 

Detailed Description

Definition at line 42 of file EventBase.cpp.

Member Function Documentation

void folly::EventBase::FunctionRunner::messageAvailable ( Func &&  msg)
inlineoverridenoexcept

Definition at line 45 of file EventBase.cpp.

References folly::EventBase::evb_, and folly::NotificationQueue< MessageT >::Consumer::getEventBase().

45  {
46  // In libevent2, internal events do not break the loop.
47  // Most users would expect loop(), followed by runInEventBaseThread(),
48  // to break the loop and check if it should exit or not.
49  // To have similar bejaviour to libevent1.4, tell the loop to break here.
50  // Note that loop() may still continue to loop, but it will also check the
51  // stop_ flag as well as runInLoop callbacks, etc.
52  event_base_loopbreak(getEventBase()->evb_);
53 
54  if (!msg) {
55  // terminateLoopSoon() sends a null message just to
56  // wake up the loop. We can ignore these messages.
57  return;
58  }
59  msg();
60  }
event_base * evb_
Definition: EventBase.h:730

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