Skip to content

Commit 8079f33

Browse files
author
Bret Ambrose
committed
Checkpoint
1 parent 7cdbd39 commit 8079f33

File tree

7 files changed

+522
-433
lines changed

7 files changed

+522
-433
lines changed

eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,23 @@ namespace Aws
139139
Crt::Allocator *m_allocator;
140140
};
141141

142+
enum EventStreamRpcStatusCode
143+
{
144+
EVENT_STREAM_RPC_SUCCESS = 0,
145+
EVENT_STREAM_RPC_NULL_PARAMETER,
146+
EVENT_STREAM_RPC_UNINITIALIZED,
147+
EVENT_STREAM_RPC_ALLOCATION_ERROR,
148+
EVENT_STREAM_RPC_CONNECTION_SETUP_FAILED,
149+
EVENT_STREAM_RPC_CONNECTION_ACCESS_DENIED,
150+
EVENT_STREAM_RPC_CONNECTION_ALREADY_ESTABLISHED,
151+
EVENT_STREAM_RPC_CONNECTION_CLOSED,
152+
EVENT_STREAM_RPC_CONTINUATION_CLOSED,
153+
EVENT_STREAM_RPC_UNKNOWN_PROTOCOL_MESSAGE,
154+
EVENT_STREAM_RPC_UNMAPPED_DATA,
155+
EVENT_STREAM_RPC_UNSUPPORTED_CONTENT_TYPE,
156+
EVENT_STREAM_RPC_CRT_ERROR
157+
};
158+
142159
/**
143160
* Configuration structure holding all configurations relating to eventstream RPC connection establishment
144161
*/
@@ -184,6 +201,8 @@ namespace Aws
184201
m_connectRequestCallback = connectRequestCallback;
185202
}
186203

204+
EventStreamRpcStatusCode Validate() const noexcept;
205+
187206
protected:
188207
Crt::Optional<Crt::String> m_hostName;
189208
Crt::Optional<uint32_t> m_port;
@@ -194,23 +213,6 @@ namespace Aws
194213
OnMessageFlushCallback m_connectRequestCallback;
195214
};
196215

197-
enum EventStreamRpcStatusCode
198-
{
199-
EVENT_STREAM_RPC_SUCCESS = 0,
200-
EVENT_STREAM_RPC_NULL_PARAMETER,
201-
EVENT_STREAM_RPC_UNINITIALIZED,
202-
EVENT_STREAM_RPC_ALLOCATION_ERROR,
203-
EVENT_STREAM_RPC_CONNECTION_SETUP_FAILED,
204-
EVENT_STREAM_RPC_CONNECTION_ACCESS_DENIED,
205-
EVENT_STREAM_RPC_CONNECTION_ALREADY_ESTABLISHED,
206-
EVENT_STREAM_RPC_CONNECTION_CLOSED,
207-
EVENT_STREAM_RPC_CONTINUATION_CLOSED,
208-
EVENT_STREAM_RPC_UNKNOWN_PROTOCOL_MESSAGE,
209-
EVENT_STREAM_RPC_UNMAPPED_DATA,
210-
EVENT_STREAM_RPC_UNSUPPORTED_CONTENT_TYPE,
211-
EVENT_STREAM_RPC_CRT_ERROR
212-
};
213-
214216
struct AWS_EVENTSTREAMRPC_API RpcError
215217
{
216218
explicit operator bool() const noexcept { return baseStatus == EVENT_STREAM_RPC_SUCCESS; }
@@ -268,20 +270,18 @@ namespace Aws
268270
{
269271
public:
270272

271-
explicit ClientConnection(Crt::Allocator *allocator = Crt::g_allocator) noexcept;
273+
explicit ClientConnection(Crt::Allocator *allocator, aws_client_bootstrap *bootstrap) noexcept;
272274
~ClientConnection() noexcept;
273275

274276
/**
275277
* Initiates a new outgoing event-stream-rpc connection.
276278
* @param connectionOptions Connection options.
277279
* @param connectionLifecycleHandler Handler to process connection lifecycle events.
278-
* @param clientBootstrap ClientBootstrap object to run the connection on.
279280
* @return Future that will be resolved when connection either succeeds or fails.
280281
*/
281282
std::future<RpcError> Connect(
282283
const ConnectionConfig &connectionOptions,
283-
ConnectionLifecycleHandler *connectionLifecycleHandler,
284-
Crt::Io::ClientBootstrap &clientBootstrap) noexcept;
284+
ConnectionLifecycleHandler *connectionLifecycleHandler) noexcept;
285285

286286
/**
287287
* Create a new stream.
@@ -302,12 +302,6 @@ namespace Aws
302302
*/
303303
bool IsOpen() const noexcept;
304304

305-
/**
306-
* Returns the C connection object, if it exists.
307-
* @return the C connection object, if it exists.
308-
*/
309-
struct aws_event_stream_rpc_client_connection *GetUnderlyingHandle() const noexcept;
310-
311305
private:
312306

313307
std::shared_ptr<ClientConnectionImpl> m_impl;

0 commit comments

Comments
 (0)