NAWA 0.9
Web Application Framework for C++
nawa::FastcgiRequestHandler Class Reference

#include </github/workspace/internal/nawa/RequestHandler/impl/FastcgiRequestHandler.h>

Inherits nawa::RequestHandler.

Public Member Functions

 FastcgiRequestHandler (std::shared_ptr< HandleRequestFunctionWrapper > handleRequestFunction, Config config, int concurrency)
 
 ~FastcgiRequestHandler () override
 
void start () override
 
void stop () noexcept override
 
void terminate () noexcept override
 
void join () noexcept override
 
- Public Member Functions inherited from nawa::RequestHandler
virtual ~RequestHandler ()
 
void setAppRequestHandler (std::shared_ptr< HandleRequestFunctionWrapper > handleRequestFunction) noexcept
 
void setAccessFilters (AccessFilterList accessFilters) noexcept
 
std::shared_ptr< Config const > getConfig () const noexcept
 
void setConfig (Config config) noexcept
 
void reconfigure (std::optional< std::shared_ptr< HandleRequestFunctionWrapper > > handleRequestFunction, std::optional< AccessFilterList > accessFilters, std::optional< Config > config) noexcept
 
void reconfigure (HandleRequestFunction handleRequestFunction, std::optional< AccessFilterList > accessFilters, std::optional< Config > config) noexcept
 
virtual void restart () noexcept
 
void handleRequest (Connection &connection)
 

Additional Inherited Members

- Static Public Member Functions inherited from nawa::RequestHandler
static std::unique_ptr< RequestHandlernewRequestHandler (std::shared_ptr< HandleRequestFunctionWrapper > const &handleRequestFunction, Config config, int concurrency)
 
static std::unique_ptr< RequestHandlernewRequestHandler (HandleRequestFunction handleRequestFunction, Config config, int concurrency)
 
- Protected Member Functions inherited from nawa::RequestHandler
 RequestHandler ()
 

Detailed Description

Definition at line 30 of file FastcgiRequestHandler.h.

Constructor & Destructor Documentation

◆ FastcgiRequestHandler()

FastcgiRequestHandler::FastcgiRequestHandler ( std::shared_ptr< HandleRequestFunctionWrapper handleRequestFunction,
Config  config,
int  concurrency 
)

Construct a FastcgiRequestHandler object. May throw a nawa::Exception on failure.

Parameters
handleRequestFunctionThe handleRequest function of the app.
configThe config.
concurrencyConcurrency level (number of worker threads).

Definition at line 177 of file FastcgiRequestHandler.cpp.

◆ ~FastcgiRequestHandler()

FastcgiRequestHandler::~FastcgiRequestHandler ( )
override

Definition at line 275 of file FastcgiRequestHandler.cpp.

Member Function Documentation

◆ start()

void FastcgiRequestHandler::start ( )
overridevirtual

Start request handling. Must not block and return immediately if request handling is already running. May throw a nawa::Exception on failure during startup, but ideally, all actions which could lead to errors (or preliminary checks to avoid errors) should be done in the constructor, to avoid unnecessary initialization steps. Behavior of calling this function after join() has already been called is undefined, ideally, it should throw a nawa::Exception (proposed error code: 10). Please not that request handlers currently do NOT have to support restarting (i.e., calling stop, then start). The default FastCGI and HTTP request handlers do not support this and will not start request handling once again after stopping.

Implements nawa::RequestHandler.

Definition at line 285 of file FastcgiRequestHandler.cpp.

◆ stop()

void FastcgiRequestHandler::stop ( )
overridevirtualnoexcept

Stop request handling after current requests have been served. Must not block and return immediately after the shutdown has been initiated. Must do nothing if request handling has already stopped or even joined.

Implements nawa::RequestHandler.

Definition at line 305 of file FastcgiRequestHandler.cpp.

◆ terminate()

void FastcgiRequestHandler::terminate ( )
overridevirtualnoexcept

Enforce termination of request handling. Must not block and return immediately after the termination of request handling has been initiated (nevertheless, the termination should only take a few milliseconds after this function has been called). Must do nothing if request handling has already stopped or even joined.

Implements nawa::RequestHandler.

Definition at line 314 of file FastcgiRequestHandler.cpp.

◆ join()

void FastcgiRequestHandler::join ( )
overridevirtualnoexcept

Block until request handling has terminated. This is the only function that should block. If join has already been called, this function must return immediately, without throwing exceptions. By joining, the RequestHandler object becomes defunct and cannot be reused afterwards.

Implements nawa::RequestHandler.

Definition at line 323 of file FastcgiRequestHandler.cpp.


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