proxygen
|
Public Member Functions | |
RemoteAcceptor (AcceptCallback *callback, ConnectionEventCallback *connectionEventCallback) | |
~RemoteAcceptor () override=default | |
void | start (EventBase *eventBase, uint32_t maxAtOnce, uint32_t maxInQueue) |
void | stop (EventBase *eventBase, AcceptCallback *callback) |
void | messageAvailable (QueueMessage &&message) noexceptoverride |
NotificationQueue< QueueMessage > * | getQueue () |
Private Attributes | |
AcceptCallback * | callback_ |
ConnectionEventCallback * | connectionEventCallback_ |
NotificationQueue< QueueMessage > | queue_ |
Additional Inherited Members | |
Private Types inherited from folly::NotificationQueue< MessageT >::Consumer | |
enum | : uint16_t { kDefaultMaxReadAtOnce = 10 } |
Private 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 |
NotificationQueue * | getCurrentQueue () const |
void | setMaxReadAtOnce (uint32_t maxAtOnce) |
uint32_t | getMaxReadAtOnce () const |
EventBase * | getEventBase () |
void | handlerReady (uint16_t events) noexceptoverride |
template<typename TCallback > | |
std::unique_ptr< typename NotificationQueue< MessageT >::Consumer, DelayedDestruction::Destructor > | make (TCallback &&callback) |
void | destroy () override |
~Consumer () override | |
Private Member Functions inherited from folly::DelayedDestruction | |
bool | getDestroyPending () const |
~DelayedDestruction () override=default | |
DelayedDestruction () | |
Private Member Functions inherited from folly::DelayedDestructionBase | |
virtual | ~DelayedDestructionBase ()=default |
DelayedDestructionBase () | |
uint32_t | getDestructorGuardCount () const |
Static Private Member Functions inherited from folly::NotificationQueue< MessageT >::Consumer | |
template<typename TCallback > | |
static std::unique_ptr< Consumer, DelayedDestruction::Destructor > | make (TCallback &&callback) |
A class to receive notifications to invoke AcceptCallback objects in other EventBase threads.
A RemoteAcceptor object is created for each AcceptCallback that is installed in a separate EventBase thread. The RemoteAcceptor receives notification of new sockets via a NotificationQueue, and then invokes the AcceptCallback.
Definition at line 761 of file AsyncServerSocket.h.
|
inlineexplicit |
Definition at line 763 of file AsyncServerSocket.h.
References folly::pushmi::__adl::noexcept(), start, stop(), and uint32_t.
|
overridedefault |
|
inline |
Definition at line 776 of file AsyncServerSocket.h.
Referenced by folly::AsyncServerSocket::dispatchError(), and folly::AsyncServerSocket::dispatchSocket().
|
overridenoexcept |
Definition at line 114 of file AsyncServerSocket.cpp.
References folly::AsyncServerSocket::AcceptCallback::acceptError(), callback_, folly::AsyncServerSocket::AcceptCallback::connectionAccepted(), connectionEventCallback_, folly::AsyncServerSocket::MSG_ERROR, folly::AsyncServerSocket::MSG_NEW_CONN, and folly::AsyncServerSocket::ConnectionEventCallback::onConnectionDequeuedByAcceptorCallback().
void folly::AsyncServerSocket::RemoteAcceptor::start | ( | EventBase * | eventBase, |
uint32_t | maxAtOnce, | ||
uint32_t | maxInQueue | ||
) |
Definition at line 82 of file AsyncServerSocket.cpp.
References queue_, folly::EventBase::runInEventBaseThread(), and folly::NotificationQueue< MessageT >::Consumer::setMaxReadAtOnce().
Referenced by folly::AsyncServerSocket::addAcceptCallback().
void folly::AsyncServerSocket::RemoteAcceptor::stop | ( | EventBase * | eventBase, |
AcceptCallback * | callback | ||
) |
Definition at line 100 of file AsyncServerSocket.cpp.
References folly::EventBase::runInEventBaseThread().
Referenced by folly::AsyncServerSocket::removeAcceptCallback().
|
private |
Definition at line 781 of file AsyncServerSocket.h.
Referenced by messageAvailable().
|
private |
Definition at line 782 of file AsyncServerSocket.h.
Referenced by messageAvailable().
|
private |
Definition at line 784 of file AsyncServerSocket.h.
Referenced by start().