Multicasts pattern

A multicast is a consume calling on multiple notify subroutines. When a consume, supported by a svc_subr service, is invoked, it fires all subroutine notifies on that service.

In the example in Table 1, once the consume is satisfied, all subroutine notifies on the same service are fired.

Table 1. svc_subr - Multicasts
Example Description
<service name="ForeCaster" 
  provision="subr"/>
...  
<consume name="WillRain" 
  service="Subr" 
  fields="RAIN">
  <prop name="subr.spec" 
  function="FunRain" 
  Rain="RAIN"/>
</consume>
...
<notify name="GetUmbrella" 
  service="Sequencer" 
  clients="Subr" 
  fields="UMBRELLA">
  <prop name="subr.spec" 
    function="FunRain" 
    Rain="UMBRELLA"/>
</notify>
...
<notify name="CloseWindow" 
  service="Sequencer" 
  clients="Subr" 
  fields="CLOSE">
  <prop name="subr.spec" 
    function="FunRain" 
    Rain="CLOSE"/>
</notify>
...
<notify name="CancelTennis" 
  service="Sequencer" 
  clients="Subr" 
  fields="CANCEL">
  <prop name="subr.spec" 
    function="FunRain" 
    Rain="CANCEL"/>
</notify>
The consume WillRain is supported by the svc_subr service ForeCaster.

The three notify operations all specify this same service as client.

The subr.spec properties in all operations:
  • Specify the same function, FunRain
  • Map the operation fields to the same parameter, Rain
Note: The fields RAIN, UMBRELLA, CLOSE, and CANCEL are all flag fields.
Whenever the WillRain consume is satisfied, the ForeCaster service fires all three notifies.

It does not matter whether the notifies are inside the same mix or each inside a different mix or folder.