mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +00:00
Stasis documentation updates.
(issue ASTERISK-20887) (issue ASTERISK-20959) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -35,9 +35,6 @@
|
|||||||
* within Asterisk. It is designed to be:
|
* within Asterisk. It is designed to be:
|
||||||
* - Loosely coupled; new message types can be added in seperate modules.
|
* - Loosely coupled; new message types can be added in seperate modules.
|
||||||
* - Easy to use; publishing and subscribing are straightforward operations.
|
* - Easy to use; publishing and subscribing are straightforward operations.
|
||||||
* - Consistent memory management; all message bus objects are AO2 managed
|
|
||||||
* objects, using ao2_ref() and ao2_cleanup() to manage the reference
|
|
||||||
* counting.
|
|
||||||
*
|
*
|
||||||
* There are three main concepts for using the Stasis Message Bus:
|
* There are three main concepts for using the Stasis Message Bus:
|
||||||
* - \ref stasis_message
|
* - \ref stasis_message
|
||||||
@@ -75,11 +72,12 @@
|
|||||||
* to the topic is dispatched to all of its subscribers. The topic itself may be
|
* to the topic is dispatched to all of its subscribers. The topic itself may be
|
||||||
* named, which is useful in debugging.
|
* named, which is useful in debugging.
|
||||||
*
|
*
|
||||||
* Topics themselves are reference counted objects, and automagically
|
* Topics themselves are reference counted objects. Since topics are referred to
|
||||||
* unsubscribe all of their subscribers when they are destroyed. Topics are also
|
* by their subscibers, they will not be freed until all of their subscribers
|
||||||
* thread safe, so no worries about publishing/subscribing/unsubscribing to a
|
* have unsubscribed. Topics are also thread safe, so no worries about
|
||||||
* topic concurrently from multiple threads. It's also designed to handle the
|
* publishing/subscribing/unsubscribing to a topic concurrently from multiple
|
||||||
* case of unsubscribing from a topic from within the subscription handler.
|
* threads. It's also designed to handle the case of unsubscribing from a topic
|
||||||
|
* from within the subscription handler.
|
||||||
*
|
*
|
||||||
* \par Forwarding
|
* \par Forwarding
|
||||||
*
|
*
|
||||||
@@ -110,8 +108,10 @@
|
|||||||
* removed from the cache). A stasis_cache_clear_create() message must be sent
|
* removed from the cache). A stasis_cache_clear_create() message must be sent
|
||||||
* to the topic in order to remove entries from the cache.
|
* to the topic in order to remove entries from the cache.
|
||||||
*
|
*
|
||||||
* As with all things Stasis, the \ref stasis_caching_topic is a reference
|
* In order to unsubscribe a \ref stasis_caching_topic from the upstream topic,
|
||||||
* counted AO2 object.
|
* call stasis_caching_unsubscribe(). Due to cyclic references, the \ref
|
||||||
|
* stasis_caching_topic will not be freed until after it has been unsubscribed,
|
||||||
|
* and all other ao2_ref()'s have been cleaned up.
|
||||||
*
|
*
|
||||||
* \par stasis_subscriber
|
* \par stasis_subscriber
|
||||||
*
|
*
|
||||||
@@ -122,12 +122,10 @@
|
|||||||
* threads (this usually isn't important unless you use thread locals or
|
* threads (this usually isn't important unless you use thread locals or
|
||||||
* something similar).
|
* something similar).
|
||||||
*
|
*
|
||||||
* Since the topic (by necessity) holds a reference to the subscription,
|
* In order to stop receiving messages, call stasis_unsubscribe() with your \ref
|
||||||
* reference counting alone is insufficient to terminate a subscription. In
|
* stasis_subscription. Due to cyclic references, the \ref
|
||||||
* order to stop receiving messages, call stasis_unsubscribe() with your \ref
|
* stasis_subscription will not be freed until after it has been unsubscribed,
|
||||||
* stasis_subscription. This will remove the topic's reference to the
|
* and all other ao2_ref()'s have been cleaned up.
|
||||||
* subscription, and allow it to be destroyed when all of the other references
|
|
||||||
* are cleaned up.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "asterisk/utils.h"
|
#include "asterisk/utils.h"
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
|||||||
#define NUM_CACHE_BUCKETS 563
|
#define NUM_CACHE_BUCKETS 563
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*! \private */
|
||||||
struct stasis_caching_topic {
|
struct stasis_caching_topic {
|
||||||
struct ao2_container *cache;
|
struct ao2_container *cache;
|
||||||
struct stasis_topic *topic;
|
struct stasis_topic *topic;
|
||||||
|
|||||||
Reference in New Issue
Block a user