Asterisk - The Open Source Telephony Project
18.5.0
|
Stasis Message API. More...
#include "asterisk.h"
#include "asterisk/astobj2.h"
#include "asterisk/hashtab.h"
#include "asterisk/stasis_internal.h"
#include "asterisk/stasis.h"
#include "asterisk/utils.h"
#include "asterisk/vector.h"
Go to the source code of this file.
Data Structures | |
struct | cache_dump_data |
struct | cache_entry_key |
The key for an entry in the cache. More... | |
struct | cache_put_snapshots |
struct | stasis_cache |
struct | stasis_cache_entry |
struct | stasis_caching_topic |
Macros | |
#define | NUM_CACHE_BUCKETS 563 |
Functions | |
static void | cache_dtor (void *obj) |
static int | cache_dump_all_cb (void *obj, void *arg, int flags) |
static int | cache_dump_by_eid_cb (void *obj, void *arg, int flags) |
static struct stasis_message * | cache_entry_by_eid (const struct stasis_cache_entry *entry, const struct ast_eid *eid) |
static int | cache_entry_cmp (void *obj, void *arg, int flags) |
static void | cache_entry_compute_hash (struct cache_entry_key *key) |
static struct stasis_cache_entry * | cache_entry_create (struct stasis_message_type *type, const char *id, struct stasis_message *snapshot) |
static void | cache_entry_dtor (void *obj) |
static int | cache_entry_dump (struct ao2_container *snapshots, const struct stasis_cache_entry *entry) |
static int | cache_entry_hash (const void *obj, int flags) |
static struct stasis_cache_entry * | cache_find (struct ao2_container *entries, struct stasis_message_type *type, const char *id) |
static struct cache_put_snapshots | cache_put (struct stasis_cache *cache, struct stasis_message_type *type, const char *id, const struct ast_eid *eid, struct stasis_message *new_snapshot) |
static struct stasis_message * | cache_remove (struct ao2_container *entries, struct stasis_cache_entry *cached_entry, const struct ast_eid *eid) |
static struct stasis_message * | cache_udpate (struct stasis_cache_entry *cached_entry, const struct ast_eid *eid, struct stasis_message *new_snapshot) |
static void | caching_topic_exec (void *data, struct stasis_subscription *sub, struct stasis_message *message) |
static void | print_cache_entry (void *v_obj, void *where, ao2_prnt_fn *prnt) |
static void | stasis_cache_cleanup (void) |
struct stasis_message * | stasis_cache_clear_create (struct stasis_message *id_message) |
A message which instructs the caching topic to remove an entry from its cache. More... | |
struct stasis_cache * | stasis_cache_create (snapshot_get_id id_fn) |
Create a cache. More... | |
struct stasis_cache * | stasis_cache_create_full (snapshot_get_id id_fn, cache_aggregate_calc_fn aggregate_calc_fn, cache_aggregate_publish_fn aggregate_publish_fn) |
Create a cache. More... | |
struct ao2_container * | stasis_cache_dump (struct stasis_cache *cache, struct stasis_message_type *type) |
Dump cached items to a subscription for the ast_eid_default entity. More... | |
struct ao2_container * | stasis_cache_dump_all (struct stasis_cache *cache, struct stasis_message_type *type) |
Dump all entity items from the cache to a subscription. More... | |
struct ao2_container * | stasis_cache_dump_by_eid (struct stasis_cache *cache, struct stasis_message_type *type, const struct ast_eid *eid) |
Dump cached items to a subscription for a specific entity. More... | |
struct stasis_message * | stasis_cache_entry_get_aggregate (struct stasis_cache_entry *entry) |
Get the aggregate cache entry snapshot. More... | |
struct stasis_message * | stasis_cache_entry_get_local (struct stasis_cache_entry *entry) |
Get the local entity's cache entry snapshot. More... | |
struct stasis_message * | stasis_cache_entry_get_remote (struct stasis_cache_entry *entry, int idx) |
Get a remote entity's cache entry snapshot by index. More... | |
struct stasis_message * | stasis_cache_get (struct stasis_cache *cache, struct stasis_message_type *type, const char *id) |
Retrieve an item from the cache for the ast_eid_default entity. More... | |
struct ao2_container * | stasis_cache_get_all (struct stasis_cache *cache, struct stasis_message_type *type, const char *id) |
Retrieve all matching entity items from the cache. More... | |
struct stasis_message * | stasis_cache_get_by_eid (struct stasis_cache *cache, struct stasis_message_type *type, const char *id, const struct ast_eid *eid) |
Retrieve an item from the cache for a specific entity. More... | |
int | stasis_cache_init (void) |
static void | stasis_cache_update_dtor (void *obj) |
int | stasis_caching_accept_message_type (struct stasis_caching_topic *caching_topic, struct stasis_message_type *type) |
Indicate to a caching topic that we are interested in a message type. More... | |
struct stasis_topic * | stasis_caching_get_topic (struct stasis_caching_topic *caching_topic) |
Returns the topic of cached events from a caching topics. More... | |
int | stasis_caching_set_filter (struct stasis_caching_topic *caching_topic, enum stasis_subscription_message_filter filter) |
Set the message type filtering level on a cache. More... | |
struct stasis_caching_topic * | stasis_caching_topic_create (struct stasis_topic *original_topic, struct stasis_cache *cache) |
Create a topic which monitors and caches messages from another topic. More... | |
static void | stasis_caching_topic_dtor (void *obj) |
struct stasis_caching_topic * | stasis_caching_unsubscribe (struct stasis_caching_topic *caching_topic) |
Unsubscribes a caching topic from its upstream topic. More... | |
struct stasis_caching_topic * | stasis_caching_unsubscribe_and_join (struct stasis_caching_topic *caching_topic) |
Unsubscribes a caching topic from its upstream topic, blocking until all messages have been forwarded. More... | |
STASIS_MESSAGE_TYPE_DEFN (stasis_cache_clear_type) | |
STASIS_MESSAGE_TYPE_DEFN (stasis_cache_update_type) | |
static struct stasis_message * | update_create (struct stasis_message *old_snapshot, struct stasis_message *new_snapshot) |
Stasis Message API.
Definition in file stasis_cache.c.
#define NUM_CACHE_BUCKETS 563 |
Definition at line 42 of file stasis_cache.c.
Referenced by stasis_cache_create_full().
|
static |
Definition at line 326 of file stasis_cache.c.
References ao2_cleanup, cache, stasis_cache::entries, and NULL.
Referenced by stasis_cache_create_full().
|
static |
Definition at line 741 of file stasis_cache.c.
References ao2_cleanup, cache_entry_dump(), CMP_STOP, cache_dump_data::container, stasis_cache_entry::key, NULL, cache_entry_key::type, and cache_dump_data::type.
Referenced by stasis_cache_dump_all().
|
static |
Definition at line 697 of file stasis_cache.c.
References ao2_cleanup, ao2_link, cache_entry_by_eid(), CMP_STOP, cache_dump_data::container, cache_dump_data::eid, stasis_cache_entry::key, NULL, cache_entry_key::type, and cache_dump_data::type.
Referenced by stasis_cache_dump_by_eid().
|
static |
Definition at line 631 of file stasis_cache.c.
References stasis_cache_entry::aggregate, ast_eid_cmp(), ast_eid_default, AST_VECTOR_GET, AST_VECTOR_SIZE, stasis_cache_entry::local, NULL, and stasis_message_eid().
Referenced by cache_dump_by_eid_cb(), and stasis_cache_get_by_eid().
|
static |
Definition at line 288 of file stasis_cache.c.
References ast_assert, CMP_MATCH, cache_entry_key::id, stasis_cache_entry::key, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, OBJ_SEARCH_PARTIAL_KEY, and cache_entry_key::type.
Referenced by stasis_cache_create_full().
|
static |
Definition at line 206 of file stasis_cache.c.
References ast_hashtab_hash_string(), cache_entry_key::hash, cache_entry_key::id, stasis_message_type_hash(), and cache_entry_key::type.
Referenced by cache_entry_create(), and cache_find().
|
static |
Definition at line 212 of file stasis_cache.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_cleanup, ast_assert, ast_eid_cmp(), ast_eid_default, ast_strdup, AST_VECTOR_APPEND, AST_VECTOR_INIT, cache_entry_compute_hash(), cache_entry_dtor(), cache_entry_key::id, stasis_cache_entry::key, stasis_cache_entry::local, NULL, stasis_message_eid(), stasis_message_type(), type, and cache_entry_key::type.
Referenced by cache_put().
|
static |
Definition at line 183 of file stasis_cache.c.
References stasis_cache_entry::aggregate, ao2_cleanup, ast_free, AST_VECTOR_FREE, AST_VECTOR_GET, AST_VECTOR_SIZE, cache_entry_key::id, stasis_cache_entry::key, stasis_cache_entry::local, NULL, and cache_entry_key::type.
Referenced by cache_entry_create().
|
static |
Definition at line 563 of file stasis_cache.c.
References ao2_link, ast_assert, AST_VECTOR_GET, AST_VECTOR_SIZE, stasis_cache_entry::local, and NULL.
Referenced by cache_dump_all_cb(), and stasis_cache_get_all().
|
static |
Definition at line 266 of file stasis_cache.c.
References ast_assert, cache_entry_key::hash, OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by stasis_cache_create_full().
|
static |
Definition at line 396 of file stasis_cache.c.
References ao2_find, ast_assert, cache_entry_compute_hash(), cache_entry_key::id, id, stasis_cache_entry::key, OBJ_NOLOCK, OBJ_SEARCH_KEY, stasis_message_type_name(), type, and cache_entry_key::type.
Referenced by cache_put(), caching_topic_exec(), stasis_cache_get_all(), and stasis_cache_get_by_eid().
|
static |
Definition at line 505 of file stasis_cache.c.
References stasis_cache_entry::aggregate, cache_put_snapshots::aggregate_new, cache_put_snapshots::aggregate_old, ao2_bump, ao2_cleanup, ao2_link_flags, ao2_unlock, ao2_wrlock, ast_assert, cache_entry_create(), cache_find(), cache_remove(), cache_udpate(), NULL, OBJ_NOLOCK, cache_put_snapshots::old, and stasis_message_type().
Referenced by caching_topic_exec().
|
static |
Definition at line 425 of file stasis_cache.c.
References ao2_unlink_flags, ast_eid_cmp(), ast_eid_default, AST_VECTOR_GET, AST_VECTOR_REMOVE_UNORDERED, AST_VECTOR_SIZE, stasis_cache_entry::local, NULL, OBJ_NOLOCK, and stasis_message_eid().
Referenced by cache_put(), and caching_topic_exec().
|
static |
Definition at line 466 of file stasis_cache.c.
References ao2_bump, ast_eid_cmp(), ast_eid_default, AST_VECTOR_APPEND, AST_VECTOR_GET, AST_VECTOR_REMOVE_UNORDERED, AST_VECTOR_SIZE, stasis_cache_entry::local, NULL, and stasis_message_eid().
Referenced by cache_put().
|
static |
Definition at line 833 of file stasis_cache.c.
References stasis_cache::aggregate_publish_fn, ao2_cleanup, ao2_ref, ao2_unlock, ao2_wrlock, ast_assert, ast_debug, stasis_caching_topic::cache, cache_find(), cache_put(), cache_remove(), stasis_subscription_change::description, stasis_cache::entries, stasis_cache::id_fn, NULL, stasis_caching_topic::original_topic, stasis_cache_clear_type(), stasis_message_data(), stasis_message_eid(), stasis_message_type(), stasis_message_type_name(), stasis_publish(), stasis_subscription_change_type(), stasis_subscription_final_message(), stasis_topic_name(), stasis_topic_subscribers(), stasis_caching_topic::topic, stasis_subscription_change::uniqueid, update(), and update_create().
Referenced by stasis_caching_topic_create().
|
static |
Definition at line 937 of file stasis_cache.c.
References cache_entry_key::hash, cache_entry_key::id, stasis_cache_entry::key, stasis_message_type_name(), and cache_entry_key::type.
Referenced by stasis_caching_topic_create().
|
static |
Definition at line 1002 of file stasis_cache.c.
References stasis_cache_clear_type(), stasis_cache_update_type(), and STASIS_MESSAGE_TYPE_CLEANUP.
Referenced by stasis_cache_init().
struct stasis_message* stasis_cache_clear_create | ( | struct stasis_message * | message | ) |
A message which instructs the caching topic to remove an entry from its cache.
message | Message representative of the cache entry that should be cleared. This will become the data held in the stasis_cache_clear message. |
NULL
on error. Definition at line 778 of file stasis_cache.c.
References stasis_cache_clear_type(), and stasis_message_create().
Referenced by ast_delete_mwi_state_full(), ast_device_state_clear_cache(), ast_endpoint_shutdown(), AST_TEST_DEFINE(), clear_node_cache(), and remove_device_states_cb().
struct stasis_cache* stasis_cache_create | ( | snapshot_get_id | id_fn | ) |
Create a cache.
This is the backend store for a stasis_caching_topic. The cache is thread safe, allowing concurrent reads and writes.
The returned object is AO2 managed, so ao2_cleanup() when you're done.
id_fn | Callback to extract the id from a snapshot message. |
New | cache indexed by id_fn. |
Definition at line 360 of file stasis_cache.c.
References NULL, and stasis_cache_create_full().
Referenced by ast_presence_state_engine_init(), AST_TEST_DEFINE(), mwi_init(), and stasis_cp_all_create().
struct stasis_cache* stasis_cache_create_full | ( | snapshot_get_id | id_fn, |
cache_aggregate_calc_fn | aggregate_calc_fn, | ||
cache_aggregate_publish_fn | aggregate_publish_fn | ||
) |
Create a cache.
This is the backend store for a stasis_caching_topic. The cache is thread safe, allowing concurrent reads and writes.
The returned object is AO2 managed, so ao2_cleanup() when you're done.
id_fn | Callback to extract the id from a snapshot message. |
aggregate_calc_fn | Callback to calculate the aggregate cache entry. |
aggregate_publish_fn | Callback to publish the aggregate cache entry. |
New | cache indexed by id_fn. |
Definition at line 334 of file stasis_cache.c.
References stasis_cache::aggregate_calc_fn, stasis_cache::aggregate_publish_fn, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_alloc_options, ao2_cleanup, ao2_container_alloc_hash, cache, cache_dtor(), cache_entry_cmp(), cache_entry_hash(), stasis_cache::entries, stasis_cache::id_fn, NULL, and NUM_CACHE_BUCKETS.
Referenced by AST_TEST_DEFINE(), devstate_init(), and stasis_cache_create().
struct ao2_container* stasis_cache_dump | ( | struct stasis_cache * | cache, |
struct stasis_message_type * | type | ||
) |
Dump cached items to a subscription for the ast_eid_default entity.
cache | The cache to query. |
type | Type of message to dump (any type if NULL ). |
ao2_container | containing all matches (must be unreffed by caller) |
Definition at line 736 of file stasis_cache.c.
References ast_eid_default, and stasis_cache_dump_by_eid().
Referenced by action_presencestatelist(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), AST_TEST_DEFINE(), asterisk_publication_devicestate_refresh(), asterisk_publication_mwi_refresh(), asterisk_start_devicestate_publishing(), asterisk_start_mwi_publishing(), endpoints_scrape_cb(), load_module(), unload_module(), and xmpp_init_event_distribution().
struct ao2_container* stasis_cache_dump_all | ( | struct stasis_cache * | cache, |
struct stasis_message_type * | type | ||
) |
Dump all entity items from the cache to a subscription.
cache | The cache to query. |
type | Type of message to dump (any type if NULL ). |
ao2_container | containing all matches (must be unreffed by caller) |
Definition at line 757 of file stasis_cache.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_callback, ao2_container_alloc_list, ast_assert, cache_dump_all_cb(), cache_dump_data::container, cache_dump_data::eid, stasis_cache::entries, NULL, OBJ_MULTIPLE, OBJ_NODATA, stasis_cache_clear_type(), stasis_cache_update_type(), STASIS_MESSAGE_TYPE_DEFN(), type, and cache_dump_data::type.
Referenced by AST_TEST_DEFINE(), cache_cleanup(), and cleanup_module().
struct ao2_container* stasis_cache_dump_by_eid | ( | struct stasis_cache * | cache, |
struct stasis_message_type * | type, | ||
const struct ast_eid * | eid | ||
) |
Dump cached items to a subscription for a specific entity.
cache | The cache to query. |
type | Type of message to dump (any type if NULL ). |
eid | Specific entity id to retrieve. NULL for aggregate. |
ao2_container | containing all matches (must be unreffed by caller) |
Definition at line 718 of file stasis_cache.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_callback, ao2_container_alloc_list, ast_assert, cache_dump_by_eid_cb(), cache_dump_data::container, cache_dump_data::eid, stasis_cache::entries, NULL, OBJ_MULTIPLE, OBJ_NODATA, type, and cache_dump_data::type.
Referenced by action_devicestatelist(), AST_TEST_DEFINE(), cpg_confchg_cb(), and stasis_cache_dump().
struct stasis_message* stasis_cache_entry_get_aggregate | ( | struct stasis_cache_entry * | entry | ) |
Get the aggregate cache entry snapshot.
entry | Cache entry to get the aggregate snapshot. |
Aggregate-snapshot | in cache. |
NULL | if not present. |
Definition at line 365 of file stasis_cache.c.
References stasis_cache_entry::aggregate.
Referenced by cache_test_aggregate_calc_fn(), and device_state_aggregate_calc().
struct stasis_message* stasis_cache_entry_get_local | ( | struct stasis_cache_entry * | entry | ) |
Get the local entity's cache entry snapshot.
entry | Cache entry to get the local entity's snapshot. |
Internal-snapshot | in cache. |
NULL | if not present. |
Definition at line 370 of file stasis_cache.c.
References stasis_cache_entry::local.
Referenced by cache_test_aggregate_calc_fn(), and device_state_aggregate_calc().
struct stasis_message* stasis_cache_entry_get_remote | ( | struct stasis_cache_entry * | entry, |
int | idx | ||
) |
Get a remote entity's cache entry snapshot by index.
entry | Cache entry to get a remote entity's snapshot. |
idx | Which remote entity's snapshot to get. |
Remote-entity-snapshot | in cache. |
NULL | if not present. |
Definition at line 375 of file stasis_cache.c.
References AST_VECTOR_GET, AST_VECTOR_SIZE, and NULL.
Referenced by cache_test_aggregate_calc_fn(), and device_state_aggregate_calc().
struct stasis_message* stasis_cache_get | ( | struct stasis_cache * | cache, |
struct stasis_message_type * | type, | ||
const char * | id | ||
) |
Retrieve an item from the cache for the ast_eid_default entity.
The returned item is AO2 managed, so ao2_cleanup() when you're done with it.
cache | The cache to query. |
type | Type of message to retrieve. |
id | Identity of the snapshot to retrieve. |
Message | from the cache. |
Definition at line 686 of file stasis_cache.c.
References ast_eid_default, and stasis_cache_get_by_eid().
Referenced by ast_endpoint_latest_snapshot(), AST_TEST_DEFINE(), get_cached_mwi(), has_voicemail(), presence_state_cached(), unistim_send_mwi_to_peer(), and update_registry().
struct ao2_container* stasis_cache_get_all | ( | struct stasis_cache * | cache, |
struct stasis_message_type * | type, | ||
const char * | id | ||
) |
Retrieve all matching entity items from the cache.
cache | The cache to query. |
type | Type of message to retrieve. |
id | Identity of the snapshot to retrieve. |
Container | of matching items found. |
Definition at line 587 of file stasis_cache.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, ao2_container_alloc_list, ao2_rdlock, ao2_unlock, ast_assert, cache_entry_dump(), cache_find(), stasis_cache::entries, and NULL.
Referenced by AST_TEST_DEFINE().
struct stasis_message* stasis_cache_get_by_eid | ( | struct stasis_cache * | cache, |
struct stasis_message_type * | type, | ||
const char * | id, | ||
const struct ast_eid * | eid | ||
) |
Retrieve an item from the cache for a specific entity.
The returned item is AO2 managed, so ao2_cleanup() when you're done with it.
cache | The cache to query. |
type | Type of message to retrieve. |
id | Identity of the snapshot to retrieve. |
eid | Specific entity id to retrieve. NULL for aggregate. |
Message | from the cache. |
Definition at line 659 of file stasis_cache.c.
References ao2_bump, ao2_cleanup, ao2_rdlock, ao2_unlock, ast_assert, cache_entry_by_eid(), cache_find(), stasis_cache::entries, and NULL.
Referenced by ast_delete_mwi_state_full(), ast_device_state_clear_cache(), AST_TEST_DEFINE(), check_cache_aggregate(), devstate_cached(), and stasis_cache_get().
int stasis_cache_init | ( | void | ) |
Definition at line 1008 of file stasis_cache.c.
References ast_register_cleanup(), stasis_cache_cleanup(), stasis_cache_clear_type(), stasis_cache_update_type(), and STASIS_MESSAGE_TYPE_INIT.
Referenced by stasis_init().
|
static |
Definition at line 783 of file stasis_cache.c.
References ao2_cleanup, stasis_cache_update::new_snapshot, NULL, stasis_cache_update::old_snapshot, stasis_cache_update::type, and update().
Referenced by update_create().
int stasis_caching_accept_message_type | ( | struct stasis_caching_topic * | caching_topic, |
struct stasis_message_type * | type | ||
) |
Indicate to a caching topic that we are interested in a message type.
This will cause the caching topic to receive messages of the given message type. This enables internal filtering in the stasis message bus to reduce messages.
caching_topic | The caching topic. |
type | The message type we wish to receive. |
0 | on success |
-1 | failure |
Definition at line 90 of file stasis_cache.c.
References stasis_cache_clear_type(), stasis_subscription_accept_message_type(), stasis_subscription_change_type(), and stasis_caching_topic::sub.
Referenced by ast_presence_state_engine_init(), devstate_init(), and stasis_cp_single_accept_message_type().
struct stasis_topic* stasis_caching_get_topic | ( | struct stasis_caching_topic * | caching_topic | ) |
Returns the topic of cached events from a caching topics.
caching_topic | The caching topic. |
NULL
if caching_topic is NULL
. Definition at line 85 of file stasis_cache.c.
References stasis_caching_topic::topic.
Referenced by ast_device_state_topic_cached(), ast_mwi_topic_cached(), ast_presence_state_topic_cached(), AST_TEST_DEFINE(), stasis_cp_single_create(), and stasis_cp_single_topic_cached().
int stasis_caching_set_filter | ( | struct stasis_caching_topic * | caching_topic, |
enum stasis_subscription_message_filter | filter | ||
) |
Set the message type filtering level on a cache.
This will cause the underlying subscription to filter messages according to the provided filter level. For example if selective is used then only messages matching those provided to stasis_subscription_accept_message_type will be raised to the subscription callback.
caching_topic | The caching topic. |
filter | What filter to use |
0 | on success |
-1 | failure |
Definition at line 109 of file stasis_cache.c.
References stasis_subscription_set_filter(), and stasis_caching_topic::sub.
Referenced by ast_presence_state_engine_init(), devstate_init(), and stasis_cp_single_set_filter().
struct stasis_caching_topic* stasis_caching_topic_create | ( | struct stasis_topic * | original_topic, |
struct stasis_cache * | cache | ||
) |
Create a topic which monitors and caches messages from another topic.
The idea is that some topics publish 'snapshots' of some other object's state that should be cached. When these snapshot messages are received, the cache is updated, and a stasis_cache_update() message is forwarded, which has both the original snapshot message and the new message.
The returned object is AO2 managed, so ao2_cleanup() when done with it.
original_topic | Topic publishing snapshot messages. |
cache | Backend cache in which to keep snapshots. |
NULL
on error Definition at line 948 of file stasis_cache.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_container_register(), ao2_ref, ast_asprintf, ast_atomic_fetchadd_int(), ast_free, ast_log, stasis_caching_topic::cache, cache, caching_topic_exec(), stasis_cache::entries, internal_stasis_subscribe(), LOG_ERROR, NULL, stasis_caching_topic::original_topic, print_cache_entry(), stasis_cache::registered, stasis_caching_topic_dtor(), stasis_topic_create(), stasis_topic_name(), stasis_caching_topic::sub, and stasis_caching_topic::topic.
Referenced by ast_presence_state_engine_init(), AST_TEST_DEFINE(), devstate_init(), mwi_init(), and stasis_cp_sink_create().
|
static |
Definition at line 62 of file stasis_cache.c.
References ao2_cleanup, ao2_container_unregister(), ast_assert, stasis_caching_topic::cache, NULL, stasis_caching_topic::original_topic, stasis_subscription_is_done(), stasis_subscription_is_subscribed(), stasis_topic_name(), stasis_caching_topic::sub, and stasis_caching_topic::topic.
Referenced by stasis_caching_topic_create().
struct stasis_caching_topic* stasis_caching_unsubscribe | ( | struct stasis_caching_topic * | caching_topic | ) |
Unsubscribes a caching topic from its upstream topic.
This function returns immediately, so be sure to cleanup when stasis_subscription_final_message() is received.
caching_topic | Caching topic to unsubscribe |
NULL
for convenience Definition at line 119 of file stasis_cache.c.
References ao2_cleanup, ao2_ref, ast_log, LOG_ERROR, NULL, stasis_subscription_is_subscribed(), stasis_unsubscribe(), and stasis_caching_topic::sub.
Referenced by AST_TEST_DEFINE(), stasis_caching_unsubscribe_and_join(), and stasis_cp_single_unsubscribe().
struct stasis_caching_topic* stasis_caching_unsubscribe_and_join | ( | struct stasis_caching_topic * | caching_topic | ) |
Unsubscribes a caching topic from its upstream topic, blocking until all messages have been forwarded.
See stasis_unsubscriben_and_join() for more info on when to use this as opposed to stasis_caching_unsubscribe().
caching_topic | Caching topic to unsubscribe |
NULL
for convenience Definition at line 146 of file stasis_cache.c.
References ao2_cleanup, ao2_ref, NULL, stasis_caching_unsubscribe(), stasis_subscription_join(), and stasis_caching_topic::sub.
Referenced by AST_TEST_DEFINE(), devstate_cleanup(), mwi_cleanup(), and presence_state_engine_cleanup().
STASIS_MESSAGE_TYPE_DEFN | ( | stasis_cache_clear_type | ) |
Referenced by stasis_cache_dump_all().
STASIS_MESSAGE_TYPE_DEFN | ( | stasis_cache_update_type | ) |
|
static |
Definition at line 795 of file stasis_cache.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_cleanup, ao2_ref, ast_assert, stasis_cache_update::new_snapshot, NULL, stasis_cache_update::old_snapshot, stasis_cache_update_dtor(), stasis_cache_update_type(), stasis_message_create(), stasis_message_type(), stasis_cache_update::type, and update().
Referenced by caching_topic_exec().