14 #include <restinio/async_chain/common.hpp> 209 class actual_controller_t
final 210 :
public async_handling_controller_t< Extra_Data_Factory >
227 actual_request_handle_t request,
228 const schedulers_vector_t & schedulers )
229 : m_request{ request }
230 , m_schedulers{ schedulers }
242 const auto index_to_use = m_current;
245 if( index_to_use >= m_schedulers.size() )
247 return { no_more_schedulers_t{} };
251 return { m_schedulers[ index_to_use ] };
257 friend class builder_t;
299 template<
typename Scheduler >
301 add( Scheduler && scheduler )
304 throw exception_t{
"an attempt to add a scheduler to " 305 "a growable-size-chain builder that already " std::unique_ptr< growable_size_chain_t > m_chain
std::unique_ptr< growable_size_chain_t > release() noexcept
Stop adding of new schedulers and acquire the chain instance.
A holder of variable-size chain of asynchronous handlers.
std::size_t m_current
Index of the current scheduler to be used.
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, std::optional< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in std::optional<Value_Type> if parameter exis...
schedulers_vector_t m_schedulers
Request schedulers.
A builder of an instance of growable_size_chain.
request_handling_status_t operator()(const actual_request_handle_t &req) const
const actual_request_handle_t & request_handle() const noexcept override
Get reference to the source request.
growable_size_chain_t()=delete
void add(Scheduler &&scheduler)
Add a new scheduler to the chain.
actual_on_next_result_t on_next() override
Command to try find a next scheduler to be invoked.
growable_size_chain_t(creation_token_t)
The main constructor.
const actual_request_handle_t m_request
The source request.
schedulers_vector_t m_schedulers
The vector of schedulers.
actual_controller_t(actual_request_handle_t request, const schedulers_vector_t &schedulers)
Initializing constructor.