179template<
typename Extra_Data_Factory = no_extra_data_factory_t >
290 std::unique_ptr< growable_size_chain_t >
299 template<
typename Scheduler >
304 throw exception_t{
"an attempt to add a scheduler to "
305 "a growable-size-chain builder that already "
308 m_chain->m_schedulers.push_back(
315 std::unique_ptr< growable_size_chain_t >
m_chain;
349 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.
actual_on_next_result_t on_next() override
Command to try find a next scheduler to be invoked.
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_vector_t &schedulers)
Initializing constructor.
schedulers_vector_t m_schedulers
Request schedulers.
const actual_request_handle_t m_request
The source request.
A builder of an instance of growable_size_chain.
std::unique_ptr< growable_size_chain_t > release() noexcept
Stop adding of new schedulers and acquire the chain instance.
std::unique_ptr< growable_size_chain_t > m_chain
void add(Scheduler &&scheduler)
Add a new scheduler to the chain.
A holder of variable-size chain of asynchronous handlers.
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.
unique_async_handling_controller_t< Extra_Data_Factory > unique_controller_t
Short alias for a handling controller.
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.
generic_async_request_scheduler_t< Extra_Data_Factory > scheduler_holder_t
Short alias for a scheduler.
schedulers_vector_t m_schedulers
The vector of schedulers.
request_handling_status_t operator()(const actual_request_handle_t &req) const
growable_size_chain_t()=delete
growable_size_chain_t(creation_token_t)
The main constructor.
std::vector< scheduler_holder_t > schedulers_vector_t
Short alias for a vector of schedulers.
Exception class for all exceptions thrown by RESTinio.
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.
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.