proxygen
|
#include <ServiceWorker.h>
Public Types | |
using | AcceptorMap = std::map< AcceptorAddress, std::unique_ptr< wangle::Acceptor >> |
using | NamedAddressMap = std::map< std::string, AcceptorAddress > |
Public Member Functions | |
ServiceWorker (Service *service, RequestWorker *worker) | |
virtual | ~ServiceWorker () |
Service * | getService () const |
void | addServiceAcceptor (const folly::SocketAddress &address, std::unique_ptr< wangle::Acceptor > acceptor) |
void | addServiceAcceptor (const AcceptorAddress &accAddress, std::unique_ptr< wangle::Acceptor > acceptor) |
void | drainServiceAcceptor (const folly::SocketAddress &address) |
void | drainServiceAcceptor (const AcceptorAddress &accAddress) |
RequestWorker * | getRequestWorker () const |
const AcceptorMap & | getAcceptors () |
wangle::Acceptor * | getAcceptorByName (std::string name) const |
const AcceptorMap & | getDrainingAcceptors () |
virtual void | flushStats () |
virtual void | clearAcceptors () |
virtual void | clearDrainingAcceptors () |
wangle::IConnectionCounter * | getConnectionCounter () |
virtual void | forceStop () |
Protected Attributes | |
wangle::SimpleConnectionCounter | connectionCounter_ |
Private Member Functions | |
ServiceWorker (ServiceWorker const &)=delete | |
ServiceWorker & | operator= (ServiceWorker const &)=delete |
void | addAcceptor (const AcceptorAddress &accAddress, std::unique_ptr< wangle::Acceptor > acceptor, AcceptorMap &acceptors) |
Private Attributes | |
Service * | service_ |
RequestWorker * | worker_ |
AcceptorMap | acceptors_ |
NamedAddressMap | namedAddress_ |
AcceptorMap | drainingAcceptors_ |
ServiceWorker contains all of the per-thread information for a Service.
ServiceWorker contains a pointer back to the single global Service. It contains a list of ProxyAcceptor objects for this worker thread, one per VIP.
ServiceWorker fits into the Proxygen object hierarchy as follows:
Definition at line 37 of file ServiceWorker.h.
using proxygen::ServiceWorker::AcceptorMap = std::map<AcceptorAddress, std::unique_ptr<wangle::Acceptor>> |
Definition at line 40 of file ServiceWorker.h.
Definition at line 42 of file ServiceWorker.h.
|
inline |
Definition at line 44 of file ServiceWorker.h.
|
inlinevirtual |
Definition at line 48 of file ServiceWorker.h.
|
privatedelete |
|
inlineprivate |
Definition at line 140 of file ServiceWorker.h.
References folly::gen::move.
Referenced by addServiceAcceptor(), and drainServiceAcceptor().
|
inline |
Definition at line 55 of file ServiceWorker.h.
References folly::gen::move, and proxygen::AcceptorAddress::TCP.
|
inline |
Definition at line 62 of file ServiceWorker.h.
References acceptors_, addAcceptor(), wangle::Acceptor::getName(), folly::gen::move, and namedAddress_.
|
inlinevirtual |
Definition at line 115 of file ServiceWorker.h.
References acceptors_, drainingAcceptors_, and namedAddress_.
|
inlinevirtual |
Definition at line 121 of file ServiceWorker.h.
References drainingAcceptors_.
|
inline |
Definition at line 68 of file ServiceWorker.h.
References proxygen::AcceptorAddress::TCP.
|
inline |
Definition at line 73 of file ServiceWorker.h.
References acceptors_, addAcceptor(), drainingAcceptors_, folly::gen::move, name, and namedAddress_.
|
inlinevirtual |
Definition at line 111 of file ServiceWorker.h.
|
inlinevirtual |
Definition at line 129 of file ServiceWorker.h.
|
inline |
Find an acceptor by name running in the same request worker.
Definition at line 95 of file ServiceWorker.h.
References acceptors_, and namedAddress_.
|
inline |
|
inline |
Definition at line 125 of file ServiceWorker.h.
References connectionCounter_.
|
inline |
Definition at line 106 of file ServiceWorker.h.
References drainingAcceptors_.
|
inline |
|
inline |
|
privatedelete |
|
private |
A list of the Acceptor objects specific to this worker thread, one Acceptor per VIP.
Definition at line 162 of file ServiceWorker.h.
Referenced by addServiceAcceptor(), clearAcceptors(), drainServiceAcceptor(), getAcceptorByName(), and getAcceptors().
|
protected |
Definition at line 133 of file ServiceWorker.h.
Referenced by getConnectionCounter().
|
private |
A list of Acceptors that are being drained and will be deleted soon.
Definition at line 173 of file ServiceWorker.h.
Referenced by clearAcceptors(), clearDrainingAcceptors(), drainServiceAcceptor(), and getDrainingAcceptors().
|
private |
A list of the addresses indexed by name, used to look up an acceptor by name
Definition at line 168 of file ServiceWorker.h.
Referenced by addServiceAcceptor(), clearAcceptors(), drainServiceAcceptor(), and getAcceptorByName().
|
private |
The global Service object.
Definition at line 150 of file ServiceWorker.h.
Referenced by getService().
|
private |
The RequestWorker that is actually responsible for running the EventBase loop in this thread.
Definition at line 156 of file ServiceWorker.h.
Referenced by getRequestWorker().