Subscription class

a class that captures data related to an individual subscription or a batch subscription.

Note that batch subscriptions are treated as an individual subscription as only one subscription message is sent to the broker.

A batch subscription contains additional information see subscriptions below.

Constructors

Subscription()

Properties

allTopics List<String>
Get all the topics in the batch.
no setter
batch bool
Indicates a batch subscription.
getter/setter pair
changes Stream<List<ChangeRecord>?>
Emits a list of changes when the state of the object changes.
no setterinherited
createdTime DateTime?
The time the subscription was created.
getter/setter pair
failedSubscriptions List<BatchSubscription>
Failed batch subscriptions. Only valid when the subscription becomes active, i.e. we know the status of the QoS grants from the broker.
no setter
hashCode int
The hash code for this object.
no setteroverride
hasObservers bool
True if this object has any observers.
no setterinherited
messageIdentifier int?
The message identifier assigned to the subscription
getter/setter pair
qos MqttQos
QoS, if batch this is the QoS of the first topic.
getter/setter pair
requestedSubscriptions List<BatchSubscription>
The requested subscription, used in re subscribe operations. Empty if a single subscription.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscriptions List<BatchSubscription>
Empty if a single subscription.
getter/setter pair
succeededSubscriptions List<BatchSubscription>
Succeeded batch subscriptions. Will reflect the user supplied QoS levels while the subscription is pending.
no setter
topic SubscriptionTopic
The Topic that is subscribed to. For a batch subscription the first topic in the batch.
getter/setter pair
totalBatchSubscriptions int
Total batch subscriptions.
no setter
totalFailedSubscriptions int
Total failed batch subscriptions.
no setter
totalSucceededSubscriptions int
Total succeeded batch subscriptions.
no setter
unSubscriptions List<MultiUnsubscription>
List of pending unsubscriptions
getter/setter pair

Methods

deliverChanges() bool
If hasObservers, synchronously emits changes that have been queued.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyChange([ChangeRecord? change]) → void
Schedules change to be delivered.
inherited
observed() → void
May override to be notified when changes is first observed.
inherited
toString() String
A string representation of this object.
override
unobserved() → void
May override to be notified when changes is no longer observed.
inherited
updateBatchQos(List<MqttQos> qosList) bool
Update the subscriptions in the subscriptions list with the QoS grants returned by the broker. Returns false if the number of qos grants is not equal to the number of subscriptions.

Operators

operator ==(Object other) bool
The equality operator.
override