Skip to content

Kolsha/wait_all

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wait_all

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

Motivating Example #0

#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<Responses>(
        ctx.io, yield,
        makreRequestService1,
        makreRequestService2,
        // ...
        makreRequestServiceN,
    );

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

Releases

No releases published

Packages

No packages published