#ifndef AWS_HTTP_CONNECTION_MANAGER_H
#define AWS_HTTP_CONNECTION_MANAGER_H
#include <aws/http/http.h>
#include <aws/common/byte_buf.h>
struct aws_client_bootstrap;
struct aws_http_connection;
struct aws_http_connection_manager;
struct aws_socket_options;
struct aws_tls_connection_options;
struct proxy_env_var_settings;
struct aws_http2_setting;
typedef void(aws_http_connection_manager_on_connection_setup_fn)(
struct aws_http_connection *connection,
int error_code,
void *user_data);
typedef void(aws_http_connection_manager_shutdown_complete_fn)(void *user_data);
struct aws_http_manager_metrics {
size_t available_concurrency;
size_t pending_concurrency_acquires;
size_t leased_concurrency;
};
struct aws_http_connection_manager_options {
struct aws_client_bootstrap *bootstrap;
size_t initial_window_size;
const struct aws_socket_options *socket_options;
const struct aws_tls_connection_options *tls_connection_options;
bool http2_prior_knowledge;
const struct aws_http_connection_monitoring_options *monitoring_options;
struct aws_byte_cursor host;
uint16_t port;
struct aws_http2_setting *initial_settings_array;
size_t num_initial_settings;
size_t max_closed_streams;
bool http2_conn_manual_window_management;
const struct aws_http_proxy_options *proxy_options;
const struct proxy_env_var_settings *proxy_ev_settings;
size_t max_connections;
void *shutdown_complete_user_data;
aws_http_connection_manager_shutdown_complete_fn *shutdown_complete_callback;
bool enable_read_back_pressure;
uint64_t max_connection_idle_in_milliseconds;
};
AWS_EXTERN_C_BEGIN
AWS_HTTP_API
void aws_http_connection_manager_acquire(struct aws_http_connection_manager *manager);
AWS_HTTP_API
void aws_http_connection_manager_release(struct aws_http_connection_manager *manager);
AWS_HTTP_API
struct aws_http_connection_manager *aws_http_connection_manager_new(
struct aws_allocator *allocator,
struct aws_http_connection_manager_options *options);
AWS_HTTP_API
void aws_http_connection_manager_acquire_connection(
struct aws_http_connection_manager *manager,
aws_http_connection_manager_on_connection_setup_fn *callback,
void *user_data);
AWS_HTTP_API
int aws_http_connection_manager_release_connection(
struct aws_http_connection_manager *manager,
struct aws_http_connection *connection);
AWS_HTTP_API
void aws_http_connection_manager_fetch_metrics(
const struct aws_http_connection_manager *manager,
struct aws_http_manager_metrics *out_metrics);
AWS_EXTERN_C_END
#endif