#ifndef AWS_HTTP2_STREAM_MANAGER_H
#define AWS_HTTP2_STREAM_MANAGER_H
#include <aws/http/http.h>
struct aws_http2_stream_manager;
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;
struct aws_http_make_request_options;
struct aws_http_stream;
struct aws_http_manager_metrics;
typedef void(
aws_http2_stream_manager_on_stream_acquired_fn)(struct aws_http_stream *stream, int error_code, void *user_data);
typedef void(aws_http2_stream_manager_shutdown_complete_fn)(void *user_data);
struct aws_http2_stream_manager_options {
struct aws_client_bootstrap *bootstrap;
const struct aws_socket_options *socket_options;
const struct aws_tls_connection_options *tls_connection_options;
bool http2_prior_knowledge;
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 conn_manual_window_management;
bool enable_read_back_pressure;
const struct aws_http_connection_monitoring_options *monitoring_options;
const struct aws_http_proxy_options *proxy_options;
const struct proxy_env_var_settings *proxy_ev_settings;
void *shutdown_complete_user_data;
aws_http2_stream_manager_shutdown_complete_fn *shutdown_complete_callback;
bool close_connection_on_server_error;
size_t connection_ping_period_ms;
size_t connection_ping_timeout_ms;
size_t ideal_concurrent_streams_per_connection;
size_t max_concurrent_streams_per_connection;
size_t max_connections;
};
struct aws_http2_stream_manager_acquire_stream_options {
aws_http2_stream_manager_on_stream_acquired_fn *callback;
void *user_data;
const struct aws_http_make_request_options *options;
};
AWS_EXTERN_C_BEGIN
AWS_HTTP_API
struct aws_http2_stream_manager *aws_http2_stream_manager_acquire(struct aws_http2_stream_manager *manager);
AWS_HTTP_API
struct aws_http2_stream_manager *aws_http2_stream_manager_release(struct aws_http2_stream_manager *manager);
AWS_HTTP_API
struct aws_http2_stream_manager *aws_http2_stream_manager_new(
struct aws_allocator *allocator,
struct aws_http2_stream_manager_options *options);
AWS_HTTP_API
void aws_http2_stream_manager_acquire_stream(
struct aws_http2_stream_manager *http2_stream_manager,
const struct aws_http2_stream_manager_acquire_stream_options *acquire_stream_option);
AWS_HTTP_API
void aws_http2_stream_manager_fetch_metrics(
const struct aws_http2_stream_manager *http2_stream_manager,
struct aws_http_manager_metrics *out_metrics);
AWS_EXTERN_C_END
#endif