summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-06-07 12:56:56 +0000
committerKinsey Moore <kmoore@digium.com>2013-06-07 12:56:56 +0000
commit759a7e4a30b5e69738670494e5c19b6982a34644 (patch)
tree56e190b02bf90267738a4da3f0c8bb87e55424eb /include
parent611416623748504be81c58b455205a4bc7fff414 (diff)
Rework stasis cache clear events
Stasis cache clear message payloads now consist of a stasis_message representative of the message to be cleared from the cache. This allows multiple parallel caches to coexist and be cleared properly by the same cache clear message even when keyed on different fields. This change fixes a bug where multiple cache clears could be posted for channels. The cache clear is now produced in the destructor instead of ast_hangup. Additionally, dummy channels are no longer capable of producing channel snapshots. Review: https://reviewboard.asterisk.org/r/2596 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390830 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/stasis.h34
1 files changed, 13 insertions, 21 deletions
diff --git a/include/asterisk/stasis.h b/include/asterisk/stasis.h
index fdc629324..6a55d0926 100644
--- a/include/asterisk/stasis.h
+++ b/include/asterisk/stasis.h
@@ -502,31 +502,11 @@ struct stasis_cache_update {
};
/*!
- * \brief Cache clear message.
- */
-struct stasis_cache_clear {
- /*! Type of object being cleared from the cache */
- struct stasis_message_type *type;
- /*! Id of the object being cleared from the cache */
- char id[];
-};
-
-/*!
- * \brief Message type for \ref stasis_cache_clear.
+ * \brief Message type for clearing a message from a stasis cache.
* \since 12
*/
struct stasis_message_type *stasis_cache_clear_type(void);
-/*!
- * \brief A message which instructs the caching topic to remove an entry from its cache.
- * \param type Message type.
- * \param id Unique id of the snapshot to clear.
- * \return Message which, when sent to the \a topic, will clear the item from the cache.
- * \return \c NULL on error.
- * \since 12
- */
-struct stasis_message *stasis_cache_clear_create(struct stasis_message_type *type, const char *id);
-
/*! @} */
/*! @{ */
@@ -538,6 +518,18 @@ struct stasis_message *stasis_cache_clear_create(struct stasis_message_type *typ
struct stasis_caching_topic;
/*!
+ * \brief A message which instructs the caching topic to remove an entry from its cache.
+ *
+ * \param message Message representative of the cache entry that should be cleared.
+ * This will become the data held in the stasis_cache_clear message.
+ *
+ * \return Message which, when sent to the \a topic, will clear the item from the cache.
+ * \return \c NULL on error.
+ * \since 12
+ */
+struct stasis_message *stasis_cache_clear_create(struct stasis_message *message);
+
+/*!
* \brief Callback extract a unique identity from a snapshot message.
*
* This identity is unique to the underlying object of the snapshot, such as the