proxygen
proxygen::RequestHandlerFactory Class Referenceabstract

#include <RequestHandlerFactory.h>

Inheritance diagram for proxygen::RequestHandlerFactory:
DummyFilterFactory EchoHandlerFactory proxygen::RejectConnectFilterFactory proxygen::ScopedHandlerFactory< HandlerType > proxygen::ZlibServerFilterFactory ProxyHandlerFactory PushRequestHandlerFactory TestHandlerFactory

Public Member Functions

virtual ~RequestHandlerFactory ()
 
virtual void onServerStart (folly::EventBase *evb) noexcept=0
 
virtual void onServerStop () noexcept=0
 
virtual RequestHandleronRequest (RequestHandler *, HTTPMessage *) noexcept=0
 

Detailed Description

Factory for RequestHandlers.

Definition at line 19 of file RequestHandlerFactory.h.

Constructor & Destructor Documentation

virtual proxygen::RequestHandlerFactory::~RequestHandlerFactory ( )
inlinevirtual

Member Function Documentation

virtual RequestHandler* proxygen::RequestHandlerFactory::onRequest ( RequestHandler ,
HTTPMessage  
)
pure virtualnoexcept

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.

Implemented in TestHandlerFactory, proxygen::ZlibServerFilterFactory, DummyFilterFactory, proxygen::RejectConnectFilterFactory, proxygen::ScopedHandlerFactory< HandlerType >, ProxyHandlerFactory, EchoHandlerFactory, and PushRequestHandlerFactory.

Referenced by ~RequestHandlerFactory().

virtual void proxygen::RequestHandlerFactory::onServerStart ( folly::EventBase evb)
pure virtualnoexcept

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).

Implemented in TestHandlerFactory, proxygen::ZlibServerFilterFactory, DummyFilterFactory, proxygen::RejectConnectFilterFactory, proxygen::ScopedHandlerFactory< HandlerType >, ProxyHandlerFactory, EchoHandlerFactory, and PushRequestHandlerFactory.

Referenced by ~RequestHandlerFactory().

virtual void proxygen::RequestHandlerFactory::onServerStop ( )
pure virtualnoexcept

Invoked in each handler thread after all the connections are drained from that thread. Can be used to tear down thread-local setup.

Implemented in TestHandlerFactory, proxygen::ZlibServerFilterFactory, DummyFilterFactory, proxygen::RejectConnectFilterFactory, proxygen::ScopedHandlerFactory< HandlerType >, ProxyHandlerFactory, EchoHandlerFactory, and PushRequestHandlerFactory.

Referenced by ~RequestHandlerFactory().


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