stasis.c: Added topic_all container

Added topic_all container for centralizing the topic. This makes more
easier to managing the topics.

Added cli commands.
stasis show topics : It shows all registered topics.
stasis show topic <name> : It shows speicifed topic's detail info.

ASTERISK-28264

Change-Id: Ie86d125d2966f93de74ee00f47ae6fbc8c081c5f
This commit is contained in:
sungtae kim
2019-01-26 22:51:48 +01:00
committed by sungtae kim
parent eebc98fa44
commit 5815597a21
2 changed files with 350 additions and 16 deletions

View File

@@ -519,15 +519,56 @@ struct stasis_topic;
*/
struct stasis_topic *stasis_topic_create(const char *name);
/*!
* \brief Create a new topic with given detail.
* \param name Name of the new topic.
* \param detail Detail description of the new topic. i.e. "Queue main topic for subscribing every queue event"
* \return New topic instance.
* \return \c NULL on error.
*
* \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_with_detail(
const char *name, const char *detail);
/*!
* \brief Get a topic of the given name.
* \param name Topic's name.
* \return Name of the topic.
* \return \c NULL on error or not exist.
*
* \note This SHOULD NOT be used in normal operation for publishing messages.
*/
struct stasis_topic *stasis_topic_get(const char *name);
/*!
* \brief Return the uniqueid of a topic.
* \param topic Topic.
* \return Uniqueid of the topic.
* \return \c NULL if topic is \c NULL.
*/
const char *stasis_topic_uniqueid(const struct stasis_topic *topic);
/*!
* \brief Return the name of a topic.
* \param topic Topic.
* \return Name of the topic.
* \return \c NULL if topic is \c NULL.
* \since 12
*/
const char *stasis_topic_name(const struct stasis_topic *topic);
/*!
* \brief Return the detail of a topic.
* \param topic Topic.
* \return Detail of the topic.
* \return \c NULL if topic is \c NULL.
* \since 12
*/
const char *stasis_topic_detail(const struct stasis_topic *topic);
/*!
* \brief Return the number of subscribers of a topic.
* \param topic Topic.