2
3
4
5
9#include <restinio/request_handler.hpp>
15
16
17
18
19
20
21
22
23
34
35
36
37
38
39
40
41
42
43
44
45
46
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
79
80
81
82
88
89
90
91
99
100
101
102
103
104
105
109
110
111
112
113
114
115
116
117
125template<
typename Extra_Data_Factory >
127next( unique_async_handling_controller_t< Extra_Data_Factory > controller );
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144template<
typename Extra_Data_Factory >
148 template<
typename Extra_Data_Factory_For_Next >
150 next( unique_async_handling_controller_t< Extra_Data_Factory_For_Next > controller );
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
191
192
193
194
195
196
197
198
199
209
210
211
212
213
214
215
216
217
218template<
typename Request_Handle >
226
227
228
229
230
231
232
233
234
235template<
typename Request_Handle >
243
244
245
246
247
248
249
250
251
252
253template<
typename Extra_Data_Factory >
260 const generic_async_request_scheduler_t< Extra_Data_Factory > & handler )
const
264 const auto req = m_controller->request_handle();
265 const auto schedule_result = handler( std::move(m_controller) );
266 switch( schedule_result )
275 make_internal_server_error_response( req );
284 make_not_implemented_response( m_controller->request_handle() );
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325template<
typename Extra_Data_Factory >
327next( unique_async_handling_controller_t< Extra_Data_Factory > controller )
331 controller->on_next() );
Interface of a controller of an async chan.
virtual actual_on_next_result_t on_next()=0
Command to try find a next scheduler to be invoked.
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.
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.
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.
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.