272 if constexpr( 0
u !=
sizeof...(tail) )
273 store_to( index + 1u, std::forward<Tail>(tail)... );
295 static_assert(
Size ==
sizeof...(schedulers),
296 "Wrong number of parameters for the constructor of "
297 "fixed_size_chain_t<Size>. Exact `Size` parameters expected" );
313 std::make_unique< actual_controller_t >(
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.
on_next_result_t< Extra_Data_Factory > actual_on_next_result_t
Short alias for the result type of on_next method.
Actual implementation of the controller interface.
std::size_t m_current
Index of the current scheduler to be used.
const actual_request_handle_t & request_handle() const noexcept override
Get reference to the source request.
actual_controller_t(actual_request_handle_t request, const schedulers_array_t &schedulers)
Initializing constructor.
const actual_request_handle_t m_request
The source request.
actual_on_next_result_t on_next() override
Command to try find a next scheduler to be invoked.
schedulers_array_t m_schedulers
Request handlers.
A holder of fixed-size chain of asynchronous handlers.
unique_async_handling_controller_t< Extra_Data_Factory > unique_controller_t
Short alias for unique controller type.
schedulers_array_t m_schedulers
The array of schedulers.
fixed_size_chain_t(Schedulers &&...schedulers)
Initializing constructor.
fixed_size_chain_t()=delete
request_handling_status_t operator()(const actual_request_handle_t &req) const
typename async_handling_controller_t< Extra_Data_Factory >::actual_on_next_result_t actual_on_next_result_t
Short alias for the result of controller's on_next method.
std::array< scheduler_holder_t, Size > schedulers_array_t
Short alias for an array of request handlers.
generic_async_request_scheduler_t< Extra_Data_Factory > scheduler_holder_t
Short alias for a request handler.
typename async_handling_controller_t< Extra_Data_Factory >::actual_request_handle_t actual_request_handle_t
Short alias to a smart pointer to the source request.
void store_to(std::size_t index, Head &&head, Tail &&...tail)
Helper method to initialize the array of schedulers.
Common stuff for different types of async handlers chains.
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.
void next(unique_async_handling_controller_t< Extra_Data_Factory > controller)
Command to try to switch to the next handler in an async chain.
schedule_result_t
Type for return value of a scheduler in a chain.
std::unique_ptr< async_handling_controller_t< Extra_Data_Factory > > unique_async_handling_controller_t
Short alias for unique_ptr to async_handling_controller.
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.
constexpr request_handling_status_t request_accepted() noexcept
request_handling_status_t
Request handling status.
Special type to be used as an indicator that there are no more schedulers in an async chain.