[asterisk-dev] [Code Review] 2672: Split caching out from the stasis_caching_topic
David Lee
reviewboard at asterisk.org
Mon Jul 15 08:54:24 CDT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2672/
-----------------------------------------------------------
Review request for Asterisk Developers.
Bugs: ASTERISK-22002
https://issues.asterisk.org/jira/browse/ASTERISK-22002
Repository: Asterisk
Description
-------
In working with res_stasis, I discovered a significant limitation to
the current structure of stasis_caching_topics: you cannot subscribe
to cache updates for a single channel/bridge/endpoint/etc.
To address this, this patch splits the cache away from the
stasis_caching_topic, making it a first class object. The stasis_cache
object is shared amongst individual stasis_caching_topics that are
created per channel/endpoint/etc. These are still forwarded to global
whatever_all_cached topics, so their use from most of the code does
not change.
In making these changes, I noticed that we frequently used a similar
pattern for bridges, endpoints and channels:
single_topic ----------------> all_topic
^
|
single_topic_cached ----+----> all_topic_cached
|
+----> cache
This pattern was extracted as the 'Stasis Caching Pattern', defined in
stasis_caching_pattern.h. This avoids a lot of duplicate code between
the different domain objects.
Since the cache is now disassociated from its upstream caching topics,
this also necessitated a change to how the 'guaranteed' flag worked
for retrieving from a cache. The code for handling the caching
guarantee was extracted into a 'stasis_topic_wait' function, which
works for any stasis_topic.
Diffs
-----
/trunk/include/asterisk/channel.h 394264
/trunk/include/asterisk/bridging.h 394264
/trunk/include/asterisk/app.h 394264
/trunk/channels/sig_pri.c 394264
/trunk/channels/chan_unistim.c 394264
/trunk/channels/chan_sip.c 394264
/trunk/channels/chan_mgcp.c 394264
/trunk/channels/chan_iax2.c 394264
/trunk/channels/chan_gulp.c 394264
/trunk/channels/chan_dahdi.c 394264
/trunk/apps/confbridge/confbridge_manager.c 394264
/trunk/apps/app_voicemail.c 394264
/trunk/apps/app_meetme.c 394264
/trunk/include/asterisk/channel_internal.h 394264
/trunk/include/asterisk/devicestate.h 394264
/trunk/include/asterisk/presencestate.h 394264
/trunk/include/asterisk/stasis.h 394264
/trunk/include/asterisk/stasis_bridging.h 394264
/trunk/include/asterisk/stasis_cache_pattern.h PRE-CREATION
/trunk/include/asterisk/stasis_channels.h 394264
/trunk/include/asterisk/stasis_endpoints.h 394264
/trunk/main/app.c 394264
/trunk/main/bridging.c 394264
/trunk/main/cdr.c 394264
/trunk/main/cel.c 394264
/trunk/main/channel_internal_api.c 394264
/trunk/main/cli.c 394264
/trunk/main/devicestate.c 394264
/trunk/main/endpoints.c 394264
/trunk/main/manager.c 394264
/trunk/main/manager_bridging.c 394264
/trunk/main/manager_channels.c 394264
/trunk/main/manager_endpoints.c 394264
/trunk/main/pbx.c 394264
/trunk/main/presencestate.c 394264
/trunk/main/stasis.c 394264
/trunk/main/stasis_bridging.c 394264
/trunk/main/stasis_cache.c 394264
/trunk/main/stasis_cache_pattern.c PRE-CREATION
/trunk/main/stasis_channels.c 394264
/trunk/main/stasis_endpoints.c 394264
/trunk/main/stasis_wait.c PRE-CREATION
/trunk/res/res_agi.c 394264
/trunk/res/res_chan_stats.c 394264
/trunk/res/res_sip_mwi.c 394264
/trunk/res/res_stasis.c 394264
/trunk/res/res_xmpp.c 394264
/trunk/res/stasis/control.c 394264
/trunk/res/stasis_http/resource_bridges.c 394264
/trunk/res/stasis_http/resource_channels.c 394264
/trunk/res/stasis_http/resource_endpoints.c 394264
/trunk/tests/test_cel.c 394264
/trunk/tests/test_devicestate.c 394264
/trunk/tests/test_stasis.c 394264
/trunk/tests/test_stasis_endpoints.c 394264
Diff: https://reviewboard.asterisk.org/r/2672/diff/
Testing
-------
Tests pass.
Thanks,
David Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130715/c9bd2ec6/attachment.htm>
More information about the asterisk-dev
mailing list