Skip to content

Commit 359dfe5

Browse files
authored
Idle connection culling support (#252)
* Idle connection culling support
1 parent 14da9e1 commit 359dfe5

File tree

5 files changed

+651
-95
lines changed

5 files changed

+651
-95
lines changed

include/aws/http/connection_manager.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ struct aws_http_connection_manager_options {
6969
* If set to true, the read back pressure mechanism will be enabled.
7070
*/
7171
bool enable_read_back_pressure;
72+
73+
/**
74+
* If set to a non-zero value, then connections that stay in the pool longer than the specified
75+
* timeout will be closed automatically.
76+
*/
77+
uint64_t max_connection_idle_in_milliseconds;
7278
};
7379

7480
AWS_EXTERN_C_BEGIN

include/aws/http/private/connection_manager_system_vtable.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ typedef int(aws_http_connection_manager_create_connection_fn)(const struct aws_h
2424
typedef void(aws_http_connection_manager_close_connection_fn)(struct aws_http_connection *connection);
2525
typedef void(aws_http_connection_manager_release_connection_fn)(struct aws_http_connection *connection);
2626
typedef bool(aws_http_connection_manager_is_connection_open_fn)(const struct aws_http_connection *connection);
27+
typedef bool(aws_http_connection_manager_is_callers_thread_fn)(struct aws_channel *channel);
28+
typedef struct aws_channel *(aws_http_connection_manager_connection_get_channel_fn)(
29+
struct aws_http_connection *connection);
2730

2831
struct aws_http_connection_manager_system_vtable {
2932
/*
@@ -33,6 +36,9 @@ struct aws_http_connection_manager_system_vtable {
3336
aws_http_connection_manager_close_connection_fn *close_connection;
3437
aws_http_connection_manager_release_connection_fn *release_connection;
3538
aws_http_connection_manager_is_connection_open_fn *is_connection_open;
39+
aws_io_clock_fn *get_monotonic_time;
40+
aws_http_connection_manager_is_callers_thread_fn *is_callers_thread;
41+
aws_http_connection_manager_connection_get_channel_fn *connection_get_channel;
3642
};
3743

3844
AWS_HTTP_API

0 commit comments

Comments
 (0)