awscrt.mqtt_request_response

MQTT Request Response module

class awscrt.mqtt_request_response.SubscriptionStatusEventType(value)

The type of change to the state of a streaming operation subscription

SUBSCRIPTION_ESTABLISHED = 0

The streaming operation is successfully subscribed to its topic (filter)

SUBSCRIPTION_LOST = 1

The streaming operation has temporarily lost its subscription to its topic (filter)

SUBSCRIPTION_HALTED = 2

The streaming operation has entered a terminal state where it has given up trying to subscribe to its topic (filter). This is always due to user error (bad topic filter or IoT Core permission policy).

class awscrt.mqtt_request_response.SubscriptionStatusEvent(type: SubscriptionStatusEventType | None = None, error: Exception | None = None)

An event that describes a change in subscription status for a streaming operation.

Parameters:
  • type (SubscriptionStatusEventType) – The type of status change represented by the event

  • error (Optional[Exception]) – Describes an underlying reason for the event. Only set for SubscriptionLost and SubscriptionHalted.

awscrt.mqtt_request_response.SubscriptionStatusListener

Signature for a handler that listens to subscription status events.

alias of Callable[[SubscriptionStatusEvent], None]

class awscrt.mqtt_request_response.ClientOptions(max_request_response_subscriptions: int, max_streaming_subscriptions: int, operation_timeout_in_seconds: int | None = 60)

MQTT-based request-response client configuration options

Parameters:
  • max_request_response_subscriptions (int) – Maximum number of subscriptions that the client will concurrently use for request-response operations

  • max_streaming_subscriptions (int) – Maximum number of subscriptions that the client will concurrently use for streaming operations

  • operation_timeout_in_seconds (Optional[int]) – Duration, in seconds, that a request-response operation will wait for completion before giving up

validate()

Stringently type-checks an instance’s field values.