[Asterisk-code-review] stasis: Clarify lifetime of topics. (asterisk[13])

Joshua Colp asteriskteam at digium.com
Wed Nov 7 06:06:03 CST 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/10584 )

Change subject: stasis: Clarify lifetime of topics.
......................................................................

stasis: Clarify lifetime of topics.

As mentioned in the comment I've added in the code there is no
ability to unsubscribe all subscribers from a topic and explicitly
destroy it. This is not currently a problem as we have two types of
topics:

Long lived topics which exist for the lifetime of the system.
Ephemeral topics which feed a long lived topic.

In the case of the ephemeral topics there is no subscriber which does
not have its lifetime managed by the same entity that has created
the topic. This ensures that when the topic is being unreferenced the
subscribers are also unsubscribed and destroyed, allowing the topic
to ultimately be destroyed as well.

Change-Id: Ic5e244da7b16b1895ba1fc5ece481ebba5809c9a
---
M include/asterisk/stasis.h
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/include/asterisk/stasis.h b/include/asterisk/stasis.h
index f1a09f7..25faa46 100644
--- a/include/asterisk/stasis.h
+++ b/include/asterisk/stasis.h
@@ -483,6 +483,11 @@
  * \return New topic instance.
  * \return \c NULL on error.
  * \since 12
+ *
+ * \note There is no explicit ability to unsubscribe all subscribers
+ * from a topic and destroy it. As a result the topic can persist until
+ * the last subscriber unsubscribes itself even if there is no
+ * publisher.
  */
 struct stasis_topic *stasis_topic_create(const char *name);
 

-- 
To view, visit https://gerrit.asterisk.org/10584
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic5e244da7b16b1895ba1fc5ece481ebba5809c9a
Gerrit-Change-Number: 10584
Gerrit-PatchSet: 1
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181107/d6e9e1bb/attachment.html>


More information about the asterisk-code-review mailing list