75template<
typename Extra_Data_Factory = no_extra_data_factory_t >
76class async_handling_controller_t;
83template<
typename Extra_Data_Factory = no_extra_data_factory_t >
85 std::unique_ptr< async_handling_controller_t< Extra_Data_Factory > >;
92template<
typename Extra_Data_Factory = no_extra_data_factory_t >
118template<
typename Extra_Data_Factory = no_extra_data_factory_t >
125template<
typename Extra_Data_Factory >
148 template<
typename Extra_Data_Factory_For_Next >
218template<
typename Request_Handle >
235template<
typename Request_Handle >
253template<
typename Extra_Data_Factory >
264 const auto req = m_controller->request_handle();
265 const auto schedule_result = handler( std::move(m_controller) );
266 switch( schedule_result )
268 case schedule_result_t::ok:
274 case schedule_result_t::failure:
325template<
typename Extra_Data_Factory >
Interface of a controller of an async chan.
generic_request_handle_t< typename Extra_Data_Factory::data_t > actual_request_handle_t
Short alias for request_handle type.
friend void next(unique_async_handling_controller_t< Extra_Data_Factory_For_Next > controller)
virtual actual_on_next_result_t on_next()=0
Command to try find a next scheduler to be invoked.
on_next_result_t< Extra_Data_Factory > actual_on_next_result_t
Short alias for the result type of on_next method.
generic_async_request_scheduler_t< typename Extra_Data_Factory::data_t > actual_async_request_scheduler_t
Short alias for async_request_scheduler type.
virtual ~async_handling_controller_t()=default
virtual const actual_request_handle_t & request_handle() const noexcept=0
Get reference to the source request.
void make_internal_server_error_response(const Request_Handle &req)
Helper to make a negative response with "Internal Server Error" status.
void make_not_implemented_response(const Request_Handle &req)
Helper to make a negative response with "Not Implemented" status.
std::function< schedule_result_t(unique_async_handling_controller_t< Extra_Data_Factory >) > generic_async_request_scheduler_t
Short alias for a type of a scheduler to be used in async chains.
constexpr schedule_result_t ok() noexcept
Helper function to be used if scheduling was successful.
void next(unique_async_handling_controller_t< Extra_Data_Factory > controller)
Command to try to switch to the next handler in an async chain.
std::variant< generic_async_request_scheduler_t< Extra_Data_Factory >, no_more_schedulers_t > on_next_result_t
Special type to be used as result of async_handling_controller's on_next method.
constexpr schedule_result_t failure() noexcept
Helper function to be used if scheduling failed.
schedule_result_t
Type for return value of a scheduler in a chain.
@ failure
The scheduling of the actual processing failed. Note, that there is no additional information about t...
@ ok
The scheduling of the actual processing was successful.
std::unique_ptr< async_handling_controller_t< Extra_Data_Factory > > unique_async_handling_controller_t
Short alias for unique_ptr to async_handling_controller.
std::shared_ptr< generic_request_t< Extra_Data > > generic_request_handle_t
An alias for shared-pointer to incoming request.
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
http_status_line_t status_internal_server_error()
http_status_line_t status_not_found()
Helper type to be used as handler of variant values in std::visit.
void operator()(const no_more_schedulers_t &) const
void operator()(const generic_async_request_scheduler_t< Extra_Data_Factory > &handler) const
unique_async_handling_controller_t< Extra_Data_Factory > & m_controller
Special type to be used as an indicator that there are no more schedulers in an async chain.