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