Merge commit 'c0baaa7'
[urisagit/Stem.git] / Design / switch_notes
1 Stem::Switch
2
3 The Stem::Switch cell is a very simple but powerful object which can 
4 be used in a wide range of applications.  Its primary function is to 
5 receive a message and to copy and redirect it to a list of 
6 destination cells.  It can be used as a multiplexer in many-to-one, 
7 one-to-many, and many-to-many configurations.  Currently it is used 
8 as the heart of the chat server demo and the Inetd demo. 
9
10 Stem::Switch has two maps: the input map is used to translate the 
11 incoming target address to entries in the output map.  Each input map 
12 entry can have multiple output targets and that list can be set via a 
13 configuration file at start-up time or a command message at runtime. 
14 The output map just converts the output name to an actual cell 
15 address and is one-to-one; it also is set via the configuration file 
16 or by runtime command messages.  In addition to the explicit command 
17 message technique for changing the maps, a publish/subscribe 
18 interface is supported.  A given cell can announce to a Stem::Switch 
19 cell that it will be publishing messages to a given target address in 
20 the switch.  Other cells can send a subscribe message which will 
21 cause all messages sent to the selected publish address to be 
22 forwarded to themselves. 
23