31#include <asio/any_io_executor.hpp>
32#include <asio/awaitable.hpp>
42namespace neograph::async {
44struct ConnPoolOptions {
48 std::size_t max_idle_per_host = 16;
52 std::chrono::seconds idle_ttl{30};
55class NEOGRAPH_API ConnPool {
57 explicit ConnPool(asio::any_io_executor ex,
58 ConnPoolOptions opts = {});
61 ConnPool(
const ConnPool&) =
delete;
62 ConnPool& operator=(
const ConnPool&) =
delete;
77 std::string_view host,
78 std::string_view port,
79 std::string_view path,
80 std::string_view body,
81 std::vector<std::pair<std::string, std::string>> headers = {},
83 RequestOptions opts = {});
86 std::size_t idle_count()
const;
90 std::unique_ptr<Impl> impl_;
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.