Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request operations #364

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/aws/mqtt/mqtt.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ enum aws_mqtt_error {
AWS_ERROR_MQTT_REQUEST_RESPONSE_NO_SUBSCRIPTION_CAPACITY,
AWS_ERROR_MQTT_REQUEST_RESPONSE_SUBSCRIBE_FAILURE,
AWS_ERROR_MQTT_REQUEST_RESPONSE_INTERNAL_ERROR,
AWS_ERROR_MQTT_REQUEST_RESPONSE_PUBLISH_FAILURE,

AWS_ERROR_END_MQTT_RANGE = AWS_ERROR_ENUM_END_RANGE(AWS_C_MQTT_PACKAGE_ID),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ AWS_MQTT_API void aws_rr_subscription_manager_init(
*/
AWS_MQTT_API void aws_rr_subscription_manager_clean_up(struct aws_rr_subscription_manager *manager);

/*
* Requests the the subscription manager unsubscribe from all currently-unused subscriptions
*/
AWS_MQTT_API void aws_rr_subscription_manager_purge_unused(struct aws_rr_subscription_manager *manager);

/*
* Signals to the subscription manager that the native request-response client is processing an operation that
* needs a subscription to a particular topic. Return value indicates to the request-response client how it should
Expand Down
7 changes: 5 additions & 2 deletions include/aws/mqtt/request-response/request_response_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ struct aws_mqtt_request_operation_response_path {
struct aws_byte_cursor correlation_token_json_path;
};

typedef void(
aws_mqtt_request_operation_completion_fn)(struct aws_byte_cursor *payload, int error_code, void *user_data);
typedef void(aws_mqtt_request_operation_completion_fn)(
const struct aws_byte_cursor *response_topic,
const struct aws_byte_cursor *payload,
int error_code,
void *user_data);

struct aws_mqtt_request_operation_options {
struct aws_byte_cursor subscription_topic_filter;
Expand Down
3 changes: 3 additions & 0 deletions source/mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ bool aws_mqtt_is_valid_topic_filter(const struct aws_byte_cursor *topic_filter)
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_REQUEST_RESPONSE_INTERNAL_ERROR,
"Request operation failed due to a non-specific internal error within the client."),
AWS_DEFINE_ERROR_INFO_MQTT(
AWS_ERROR_MQTT_REQUEST_RESPONSE_PUBLISH_FAILURE,
"Request-response operation failed because the associated publish failed synchronously."),

};
/* clang-format on */
Expand Down
Loading
Loading