34#include <asio/any_io_executor.hpp>
35#include <asio/awaitable.hpp>
45namespace neograph::async {
47struct ConnPoolOptions {
51 std::size_t max_idle_per_host = 16;
56 std::chrono::seconds idle_ttl{30};
62 std::size_t max_in_flight_per_host = 0;
65class NEOGRAPH_API ConnPool {
67 explicit ConnPool(asio::any_io_executor ex,
68 ConnPoolOptions opts = {});
71 ConnPool(
const ConnPool&) =
delete;
72 ConnPool& operator=(
const ConnPool&) =
delete;
84 std::string_view host,
85 std::string_view port,
86 std::string_view path,
87 std::string_view body,
88 std::vector<std::pair<std::string, std::string>> headers = {},
90 RequestOptions opts = {});
93 std::size_t idle_count()
const;
97 std::shared_ptr<Impl> impl_;
99 static asio::awaitable<HttpResponse> async_post_owned(
100 std::shared_ptr<Impl> impl,
105 std::vector<std::pair<std::string, std::string>> headers,
107 RequestOptions opts);
Minimal async HTTP/1.1 POST client on asio coroutines.
NEOGRAPH_API asio::awaitable< HttpResponse > async_post(asio::any_io_executor ex, std::string_view host, std::string_view port, std::string_view path, std::string_view body, std::vector< std::pair< std::string, std::string > > headers={}, bool tls=false, RequestOptions opts={})
Async HTTP(S) POST.