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
- Host: GitHub
- URL: https://github.com/kolsha/wait_all
- Owner: Kolsha
- Created: 2022-10-25T13:34:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-30T10:41:55.000Z (almost 3 years ago)
- Last Synced: 2025-01-13T16:28:21.722Z (9 months ago)
- Topics: asio, async, boost, boost-libraries, coroutines
- Language: C++
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
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
}
```