[asterisk-dev] [Code Review] Stasis message router

David Lee reviewboard at asterisk.org
Thu Mar 14 09:47:56 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2390/
-----------------------------------------------------------

Review request for Asterisk Developers and Matt Jordan.


Summary
-------

Yesterday afternoon, mjordan and I were lamenting the way handling
Stasis subscriptions meant that you had to write a cascading series of
if-else statements. We also talked about the possability of needing to
optimize how messages are handled in high-load scenarios.

Enter the message router. A stasis_message_router is constructed for a
particular stasis_topic, which is subscribes to. Call
stasis_message_router_unsubscribe() to cancel that subscription.

Once constructed, routes can be added using
stasis_message_router_add() (or stasis_message_router_set_default()
for any messages not handled by other routes). There may be only one
route per stasis_message_type. The route's callback is invoked just as
if it were a callback for a subscription; but it only gets called for
messages of the specified type.


Diffs
-----

  /trunk/tests/test_stasis.c 383051 
  /trunk/include/asterisk/stasis_message_router.h PRE-CREATION 
  /trunk/main/stasis.c 383051 
  /trunk/main/stasis_message_router.c PRE-CREATION 

Diff: https://reviewboard.asterisk.org/r/2390/diff


Testing
-------

Unit testing.


Thanks,

David

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130314/4913c881/attachment-0001.htm>


More information about the asterisk-dev mailing list