proxygen
folly::detail::notification_queue_consumer_wrapper< MessageT, TCallback > Struct Template Reference

#include <NotificationQueue.h>

Inheritance diagram for folly::detail::notification_queue_consumer_wrapper< MessageT, TCallback >:
folly::NotificationQueue< MessageT >::Consumer folly::DelayedDestruction folly::EventHandler folly::DelayedDestructionBase

Public Member Functions

template<typename UCallback >
 notification_queue_consumer_wrapper (UCallback &&callback)
 
void messageAvailable (MessageT &&message) noexceptoverride
 
- Public Member Functions inherited from folly::NotificationQueue< MessageT >::Consumer
 Consumer ()
 
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
 

Private Attributes

TCallback callback_
 

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

template<typename MessageT, typename TCallback>
struct folly::detail::notification_queue_consumer_wrapper< MessageT, TCallback >

Definition at line 905 of file NotificationQueue.h.

Constructor & Destructor Documentation

template<typename MessageT , typename TCallback >
template<typename UCallback >
folly::detail::notification_queue_consumer_wrapper< MessageT, TCallback >::notification_queue_consumer_wrapper ( UCallback &&  callback)
inlineexplicit

Definition at line 908 of file NotificationQueue.h.

909  : callback_(std::forward<UCallback>(callback)) {}

Member Function Documentation

template<typename MessageT , typename TCallback >
void folly::detail::notification_queue_consumer_wrapper< MessageT, TCallback >::messageAvailable ( MessageT &&  message)
inlineoverridevirtualnoexcept

messageAvailable() will be invoked whenever a new message is available from the pipe.

Implements folly::NotificationQueue< MessageT >::Consumer.

Definition at line 912 of file NotificationQueue.h.

References callback_, and folly::pushmi::__adl::noexcept().

912  {
913  static_assert(
914  noexcept(std::declval<TCallback>()(std::forward<MessageT>(message))),
915  "callback must be declared noexcept, e.g.: `[]() noexcept {}`");
916 
917  callback_(std::forward<MessageT>(message));
918  }
Definition: test.c:42
requires E e noexcept(noexcept(s.error(std::move(e))))

Member Data Documentation

template<typename MessageT , typename TCallback >
TCallback folly::detail::notification_queue_consumer_wrapper< MessageT, TCallback >::callback_
private

Definition at line 921 of file NotificationQueue.h.


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