Description
We have topic_name and topic_filter validatiton functions. They are already been meged.
I already merged tire supporting functions.
Now, it is a time to implement trie version of wildcard support to test_broker.
@kleunen , could you demonstrate how to use subscription_map and retained_topic map ?
Could you write a code example or pull request ?
I'm not sure sub_con_online and sub_con_offline need to be shared_ptr or not. I remember your previous approach uses shared_ptr for them. Please check it is still required in the current master.
I guess that you replace
Lines 1699 to 1700 in d035c5b
to subscription_map.
I think that subscription_map needs to have search by the address of endpoint_t and client_id.
Consider the following scenario.
- client1 connected to the broker with CleanStart:false SessionExpiryInterval:inifinity
- client1 subscribed topic1. Broker updates subscription_map.
- client1 disconnected. Broker need to search subscription_map by the address of endpoint_t and move it to offline one.
It is implemented using multi_index now. See tag_con.
Lines 1554 to 1557 in d035c5b
There are some kind of events to be a trigger to access to subscription_map.
- publish: access to subscription_map by topic_name and get a set of matched sub_con_online or sub_con_offline.
- subscribe: insert to subscription_map.
- unsubscribe: remove from subscription_map. The key is topic_filter.
- disconnect: move or update sub_con_online element in subscription_map. The key is the address of endpoint_t.
- connect: move or update sub_con_offine element in subscription_map. The key is client_id.
- timeout: Session expire case. remove sub_con_offline from subscription_map. The key is client_id.
@kleunen , could you tell me how to implement them ?