24#ifndef NAWA_REQUESTHANDLER_H
25#define NAWA_REQUESTHANDLER_H
59 static std::unique_ptr<RequestHandler>
73 static std::unique_ptr<RequestHandler>
81 void setAppRequestHandler(std::shared_ptr<HandleRequestFunctionWrapper> handleRequestFunction)
noexcept;
93 [[nodiscard]] std::shared_ptr<Config const>
getConfig() const noexcept;
118 std::optional<
Config> config) noexcept;
135 virtual
void stop() noexcept = 0;
157 virtual void join() noexcept = 0;
Options to check the path and invoke certain actions before forwarding the request to the app.
Reader for config files and accessor to config values.
Function wrapper for handleRequest functions of nawa apps.
virtual ~RequestHandler()
virtual void stop() noexcept=0
virtual void restart() noexcept
static std::unique_ptr< RequestHandler > newRequestHandler(std::shared_ptr< HandleRequestFunctionWrapper > const &handleRequestFunction, Config config, int concurrency)
std::shared_ptr< Config const > getConfig() const noexcept
void handleRequest(Connection &connection)
void setConfig(Config config) noexcept
virtual void join() noexcept=0
void setAccessFilters(AccessFilterList accessFilters) noexcept
void reconfigure(std::optional< std::shared_ptr< HandleRequestFunctionWrapper > > handleRequestFunction, std::optional< AccessFilterList > accessFilters, std::optional< Config > config) noexcept
virtual void terminate() noexcept=0
void setAppRequestHandler(std::shared_ptr< HandleRequestFunctionWrapper > handleRequestFunction) noexcept
Macros for frequently used patterns.
#define NAWA_DEFAULT_CONSTRUCTOR_DEF(Class)
#define NAWA_PRIVATE_DATA()
std::function< int(nawa::Connection &)> HandleRequestFunction