AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
Public Member Functions | Friends | List of all members
Aws::Eventstreamrpc::ClientContinuation Class Referencefinal

#include <EventStreamClient.h>

Public Member Functions

 ClientContinuation (ClientConnection *connection, ClientContinuationHandler &continuationHandler, Crt::Allocator *allocator) noexcept
 
 ~ClientContinuation () noexcept
 
std::future< RpcErrorActivate (const Crt::String &operation, const Crt::List< EventStreamHeader > &headers, const Crt::Optional< Crt::ByteBuf > &payload, MessageType messageType, uint32_t messageFlags, OnMessageFlushCallback onMessageFlushCallback) noexcept
 
bool IsClosed () noexcept
 
std::future< RpcErrorSendMessage (const Crt::List< EventStreamHeader > &headers, const Crt::Optional< Crt::ByteBuf > &payload, MessageType messageType, uint32_t messageFlags, OnMessageFlushCallback onMessageFlushCallback) noexcept
 

Friends

class ClientOperation
 

Detailed Description

A wrapper for event-stream-rpc client continuation.

Constructor & Destructor Documentation

◆ ClientContinuation()

Aws::Eventstreamrpc::ClientContinuation::ClientContinuation ( ClientConnection connection,
ClientContinuationHandler continuationHandler,
Crt::Allocator allocator 
)
noexcept

Create a new continuation.

Note
continuation_option's callbacks will not be invoked, and nothing will be sent across the wire until Activate() is invoked.
Parameters
connectionConnection on which open a new stream.
continuationHandlerA set of callbacks that will be invoked for continuation events.
allocatorAllocator to use.

◆ ~ClientContinuation()

Aws::Eventstreamrpc::ClientContinuation::~ClientContinuation ( )
noexcept

Member Function Documentation

◆ Activate()

std::future< RpcError > Aws::Eventstreamrpc::ClientContinuation::Activate ( const Crt::String operation,
const Crt::List< EventStreamHeader > &  headers,
const Crt::Optional< Crt::ByteBuf > &  payload,
MessageType  messageType,
uint32_t  messageFlags,
OnMessageFlushCallback  onMessageFlushCallback 
)
noexcept

Initiate a new client stream. Send new message for the new stream.

Parameters
operationName for the operation to be invoked by the peer endpoint.
headersHeaders for the eventstream message.
payloadPayload for the eventstream message.
messageTypeMessage type for the message.
messageFlagsBitmask of aws_event_stream_rpc_message_flag values.
onMessageFlushCallbackCallback to be invoked upon the message being flushed to the underlying transport.
Returns
Future that will be resolved when the message has either been written to the wire or it fails.

◆ IsClosed()

bool Aws::Eventstreamrpc::ClientContinuation::IsClosed ( )
noexcept

Check if the continuation has been closed.

Returns
True if the continuation has been closed, false otherwise.

◆ SendMessage()

std::future< RpcError > Aws::Eventstreamrpc::ClientContinuation::SendMessage ( const Crt::List< EventStreamHeader > &  headers,
const Crt::Optional< Crt::ByteBuf > &  payload,
MessageType  messageType,
uint32_t  messageFlags,
OnMessageFlushCallback  onMessageFlushCallback 
)
noexcept

Send message on the continuation.

Parameters
headersList of additional event stream headers to include on the message.
payloadMessage payload.
messageTypeMessage type for the message.
messageFlagsBitmask of aws_event_stream_rpc_message_flag values.
onMessageFlushCallbackCallback to be invoked upon the message being flushed to the underlying transport.
Returns
Future that will be resolved when the message has either been written to the wire or it fails.

Friends And Related Function Documentation

◆ ClientOperation

friend class ClientOperation
friend

The documentation for this class was generated from the following files: