rewrite HTTP interface

This commit is contained in:
Martin Michelsen
2025-11-16 13:12:33 -08:00
parent 11cc19fe3e
commit 62c4c82fcc
9 changed files with 895 additions and 831 deletions
+5 -1
View File
@@ -265,7 +265,11 @@ asio::awaitable<std::invoke_result_t<FnT, ArgTs...>> call_on_thread_pool(asio::t
// call_on_thread_pool coroutine has been destroyed)
auto promise = std::make_shared<AsyncPromise<ReturnT>>();
asio::post(pool, [bound = std::move(bound), promise]() mutable {
promise->set_value(bound());
try {
promise->set_value(bound());
} catch (...) {
promise->set_exception(std::current_exception());
}
});
co_return co_await promise->get();
}