arena-py API v1.0.1
arena .utils .mqtt
class
MQTTMatcher:
Intended to manage topic filters including wildcards.
Internally, MQTTMatcher use a prefix tree (trie) to store values associated with filters, and has an iter_match() method to iterate efficiently over all filters that match some topic name.
class
MQTTMatcher.Node:
def
topic_matches_sub(sub: str, topic: str) -> bool:
Check whether a topic matches a subscription.
For example:
- Topic "foo/bar" would match the subscription "foo/#" or "+/bar"
- Topic "non/matching" would not match the subscription "non/+/+"