2
3
6
7
8
9
10
14#include <restinio/async_chain/common.hpp>
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
204
205
206
207
208
209 class actual_controller_t
final
218
219
220
221
228 const schedulers_vector_t & schedulers )
245 if( index_to_use >= m_schedulers.size() )
251 return { m_schedulers[ index_to_use ] };
257 friend class builder_t;
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
283
284
285
286
287
288
293 return { std::move(m_chain) };
297
298
299 template<
typename Scheduler >
301 add( Scheduler && scheduler )
305 "a growable-size-chain builder that already "
308 m_chain->m_schedulers.push_back(
309 growable_size_chain_t::scheduler_holder_t{
310 std::forward<Scheduler>(scheduler)
323
324
325
326
327
332
333
334
335
339
340
341
342
343
348 unique_controller_t controller =
349 std::make_unique< actual_controller_t >(
352 next( std::move(controller) );
Interface of a controller of an async chan.
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.
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.
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.
Exception class for all exceptions thrown by RESTinio.
exception_t(const char *err)
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.