| 1 |
#ifndef AWS_EVENT_STREAM_RPC_CLIENT_H |
| 2 |
#define AWS_EVENT_STREAM_RPC_CLIENT_H |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#include <aws/event-stream/event_stream_rpc.h> |
| 9 |
|
| 10 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 11 |
|
| 12 |
struct aws_channel; |
| 13 |
struct aws_event_loop; |
| 14 |
struct aws_event_stream_rpc_client_connection; |
| 15 |
struct aws_event_stream_rpc_client_continuation_token; |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
typedef void(aws_event_stream_rpc_client_stream_continuation_fn)( |
| 22 |
struct aws_event_stream_rpc_client_continuation_token *token, |
| 23 |
const struct aws_event_stream_rpc_message_args *message_args, |
| 24 |
void *user_data); |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
typedef void(aws_event_stream_rpc_client_stream_continuation_closed_fn)( |
| 31 |
struct aws_event_stream_rpc_client_continuation_token *token, |
| 32 |
void *user_data); |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
typedef void(aws_event_stream_rpc_client_stream_continuation_terminated_fn)(void *user_data); |
| 38 |
|
| 39 |
struct aws_event_stream_rpc_client_stream_continuation_options { |
| 40 |
aws_event_stream_rpc_client_stream_continuation_fn *on_continuation; |
| 41 |
aws_event_stream_rpc_client_stream_continuation_closed_fn *on_continuation_closed; |
| 42 |
aws_event_stream_rpc_client_stream_continuation_terminated_fn *on_continuation_terminated; |
| 43 |
void *user_data; |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
typedef void(aws_event_stream_rpc_client_connection_protocol_message_fn)( |
| 50 |
struct aws_event_stream_rpc_client_connection *connection, |
| 51 |
const struct aws_event_stream_rpc_message_args *message_args, |
| 52 |
void *user_data); |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
typedef void(aws_event_stream_rpc_client_on_connection_shutdown_fn)( |
| 58 |
struct aws_event_stream_rpc_client_connection *connection, |
| 59 |
int error_code, |
| 60 |
void *user_data); |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
typedef void(aws_event_stream_rpc_client_on_connection_setup_fn)( |
| 79 |
struct aws_event_stream_rpc_client_connection *connection, |
| 80 |
int error_code, |
| 81 |
void *user_data); |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
typedef void(aws_event_stream_rpc_client_on_connection_terminated_fn)(void *user_data); |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
typedef void(aws_event_stream_rpc_client_message_flush_fn)(int error_code, void *user_data); |
| 92 |
|
| 93 |
struct aws_client_bootstrap; |
| 94 |
|
| 95 |
struct aws_event_stream_rpc_client_connection_options { |
| 96 |
|
| 97 |
const char *host_name; |
| 98 |
|
| 99 |
uint32_t port; |
| 100 |
|
| 101 |
const struct aws_socket_options *socket_options; |
| 102 |
|
| 103 |
const struct aws_tls_connection_options *tls_options; |
| 104 |
struct aws_client_bootstrap *bootstrap; |
| 105 |
aws_event_stream_rpc_client_on_connection_setup_fn *on_connection_setup; |
| 106 |
aws_event_stream_rpc_client_connection_protocol_message_fn *on_connection_protocol_message; |
| 107 |
aws_event_stream_rpc_client_on_connection_shutdown_fn *on_connection_shutdown; |
| 108 |
aws_event_stream_rpc_client_on_connection_terminated_fn *on_connection_terminated; |
| 109 |
void *user_data; |
| 110 |
}; |
| 111 |
|
| 112 |
AWS_EXTERN_C_BEGIN |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
AWS_EVENT_STREAM_API int aws_event_stream_rpc_client_connection_connect( |
| 122 |
struct aws_allocator *allocator, |
| 123 |
const struct aws_event_stream_rpc_client_connection_options *conn_options); |
| 124 |
AWS_EVENT_STREAM_API void aws_event_stream_rpc_client_connection_acquire( |
| 125 |
const struct aws_event_stream_rpc_client_connection *connection); |
| 126 |
AWS_EVENT_STREAM_API void aws_event_stream_rpc_client_connection_release( |
| 127 |
const struct aws_event_stream_rpc_client_connection *connection); |
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
AWS_EVENT_STREAM_API void aws_event_stream_rpc_client_connection_close( |
| 135 |
struct aws_event_stream_rpc_client_connection *connection, |
| 136 |
int shutdown_error_code); |
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
AWS_EVENT_STREAM_API bool aws_event_stream_rpc_client_connection_is_open( |
| 142 |
const struct aws_event_stream_rpc_client_connection *connection); |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
AWS_EVENT_STREAM_API int aws_event_stream_rpc_client_connection_send_protocol_message( |
| 153 |
struct aws_event_stream_rpc_client_connection *connection, |
| 154 |
const struct aws_event_stream_rpc_message_args *message_args, |
| 155 |
aws_event_stream_rpc_client_message_flush_fn *flush_fn, |
| 156 |
void *user_data); |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
AWS_EVENT_STREAM_API struct aws_event_loop *aws_event_stream_rpc_client_connection_get_event_loop( |
| 162 |
const struct aws_event_stream_rpc_client_connection *connection); |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
AWS_EVENT_STREAM_API struct aws_event_stream_rpc_client_continuation_token * |
| 172 |
aws_event_stream_rpc_client_connection_new_stream( |
| 173 |
struct aws_event_stream_rpc_client_connection *connection, |
| 174 |
const struct aws_event_stream_rpc_client_stream_continuation_options *continuation_options); |
| 175 |
AWS_EVENT_STREAM_API void aws_event_stream_rpc_client_continuation_acquire( |
| 176 |
const struct aws_event_stream_rpc_client_continuation_token *continuation); |
| 177 |
AWS_EVENT_STREAM_API void aws_event_stream_rpc_client_continuation_release( |
| 178 |
const struct aws_event_stream_rpc_client_continuation_token *continuation); |
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
AWS_EVENT_STREAM_API bool aws_event_stream_rpc_client_continuation_is_closed( |
| 184 |
const struct aws_event_stream_rpc_client_continuation_token *continuation); |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
AWS_EVENT_STREAM_API int aws_event_stream_rpc_client_continuation_activate( |
| 195 |
struct aws_event_stream_rpc_client_continuation_token *continuation, |
| 196 |
struct aws_byte_cursor operation_name, |
| 197 |
const struct aws_event_stream_rpc_message_args *message_args, |
| 198 |
aws_event_stream_rpc_client_message_flush_fn *flush_fn, |
| 199 |
void *user_data); |
| 200 |
|
| 201 |
AWS_EVENT_STREAM_API void *aws_event_stream_rpc_client_continuation_get_user_data( |
| 202 |
struct aws_event_stream_rpc_client_continuation_token *continuation); |
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
AWS_EVENT_STREAM_API int aws_event_stream_rpc_client_continuation_send_message( |
| 212 |
struct aws_event_stream_rpc_client_continuation_token *continuation, |
| 213 |
const struct aws_event_stream_rpc_message_args *message_args, |
| 214 |
aws_event_stream_rpc_client_message_flush_fn *flush_fn, |
| 215 |
void *user_data); |
| 216 |
|
| 217 |
AWS_EXTERN_C_END |
| 218 |
AWS_POP_SANE_WARNING_LEVEL |
| 219 |
|
| 220 |
#endif |