drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.04k stars 1.06k forks source link

async http non-block get/post request pool? #1997

Closed bethebest0622 closed 2 months ago

bethebest0622 commented 2 months ago

I need a function like this:

void http_get(const std::string & url, std::function<void<const rapidjson::Value &>> f) {
}

I need the function return immediately, and handle the return json when the server send json return back.

it's a streamed request, sometimes there are 10 request in the pool at the same time. I want it finished as quick as possible.

could you let me know which part of drogon i should pay attention to achieve this?