[Home]

Summary:ASTERISK-28154: stasis: Add support for shutting down topic
Reporter:Joshua C. Colp (jcolp)Labels:
Date Opened:2018-11-06 05:16:05.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Core/Stasis
Versions:16.0.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:This issue documents a mechanism for adding support for explicitly shutting down a topic and removing associated resources:

1. A stasis message type indicating that a topic is being shutdown should be added. This will be sent to each subscriber.

2. A stasis subscription should allow the topic to be set to NULL and stasis_unsubscribe called multiple times on it.

3. A stasis_topic_shutdown function should be added which does the following:

Lock the topic
Iterates subscriptions on the topic
Removes subscription from topic
If the subscription is not actually subscribed to the topic (forwarding case) skip it and move to next subscription
Publish a stasis_topic_shutdown message to the subscription
Publish an unsubscribe to the topic and subscription
Unsubscribe the subscription and release resources in it (the subscriber callback may have done this already, thus #2)
Unlock the topic
Release reference to the topic

4. As each subscriber receives the stasis_topic_shutdown message type it should release any reference to the subscription
Comments: