proxygen
|
#include <ScopedHTTPServer.h>
Public Member Functions | |
ScopedHandlerFactory (HandlerType handler) | |
void | onServerStart (folly::EventBase *) noexceptoverride |
void | onServerStop () noexceptoverride |
RequestHandler * | onRequest (RequestHandler *, HTTPMessage *) noexceptoverride |
Public Member Functions inherited from proxygen::RequestHandlerFactory | |
virtual | ~RequestHandlerFactory () |
Private Attributes | |
HandlerType | handler_ |
Definition at line 65 of file ScopedHTTPServer.h.
|
inlineexplicit |
Definition at line 67 of file ScopedHTTPServer.h.
|
inlineoverridevirtualnoexcept |
Invoked for each new request server handles. HTTPMessage is provided so that user can potentially choose among several implementation of handler based on URL or something. No need to save/copy this HTTPMessage. RequestHandler will be given the HTTPMessage in a separate callback.
Some request handlers don't handle the request themselves (think filters). They do take some actions based on request/response but otherwise they just hand-off request to some other RequestHandler. This upstream RequestHandler is given as first parameter. For the terminal RequestHandler this will by nullptr.
Implements proxygen::RequestHandlerFactory.
Definition at line 76 of file ScopedHTTPServer.h.
|
inlineoverridevirtualnoexcept |
Invoked in each thread server is going to handle requests before we start handling requests. Can be used to setup thread-local setup for each thread (stats and such).
Implements proxygen::RequestHandlerFactory.
Definition at line 70 of file ScopedHTTPServer.h.
|
inlineoverridevirtualnoexcept |
Invoked in each handler thread after all the connections are drained from that thread. Can be used to tear down thread-local setup.
Implements proxygen::RequestHandlerFactory.
Definition at line 73 of file ScopedHTTPServer.h.
|
private |
Definition at line 80 of file ScopedHTTPServer.h.