eidheim / Simple-Web-Server

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
MIT License
2.61k stars 751 forks source link

HttpClient::request() #224

Open Type1J opened 6 years ago

Type1J commented 6 years ago

It would be very useful if the HttpClient::request() function would return an awaitable type for use in coroutines. (See the "Naked Coroutines" talk by Gor Nishanov.)

eidheim commented 6 years ago

You can create your own wrappers using for instance https://github.com/Naios/continuabl. I have not tried this library myself, but I found this example to be interesting: https://github.com/Naios/continuable/blob/master/examples/example-asio/example-asio.cpp.

In general though, due to the complexity of this subject, I would wait for the standards committee to finish their work on coroutines.