An open API service indexing awesome lists of open source software.

https://github.com/kolsha/wait_all

waits for all handlers to complete
https://github.com/kolsha/wait_all

asio async boost boost-libraries coroutines

Last synced: 7 months ago
JSON representation

waits for all handlers to complete

Awesome Lists containing this project

README

          

# wait_all

This is C++20 library for `boost::asio` which waits for all `coroutines/awaitables/handlers` to complete.

### Motivating Example #0
```cpp
#include "wait_all/wait_all.hpp"

Response handleRequest(const Context& ctx, boost::asio::yield_context yield) {

struct Responses {
ServiceResponse1 s1;
ServiceResponse2 s2;
// ..
ServiceResponseN sN;
};

const auto responses = wait_all::waitAll(
ctx.io, yield,
makreRequestService1,
makreRequestService2,
// ...
makreRequestServiceN,
);

// compose and return Response based on responses from N services
}
```