Thread for final request processing operations.
| 257 | |
| 258 | // Thread for final request processing operations. |
| 259 | void processing_thread_func( const so_5::mchain_t& req_ch ) |
| 260 | { |
| 261 | // This flag will be set to 'true' when some of channels will be closed. |
| 262 | bool stop = false; |
| 263 | receive( |
| 264 | so_5::from( req_ch ).handle_all() |
| 265 | // If some channel become closed we should set out 'stop' flag. |
| 266 | .on_close( [&stop](const auto &) { stop = true; } ) |
| 267 | // A predicate for stopping receive() function. |
| 268 | .stop_on( [&stop]{ return stop; } ), |
| 269 | |
| 270 | // The handler of incoming request. |
| 271 | [router = create_request_handler()] |
| 272 | ( so_5::mutable_mhood_t<do_processing> cmd ) { |
| 273 | // Just call an actual router for request processing. |
| 274 | // All futher processing will be performed synchronously. |
| 275 | std::ignore = (*router)(cmd->m_controller->request_handle()); |
| 276 | }); |
| 277 | } |
| 278 | |
| 279 | int main() |
| 280 | { |
nothing calls this directly
no test coverage detected