Difference between revisions of "Selector"
Line 3: | Line 3: | ||
It manages a group of two or more 'sub-adapters'. | It manages a group of two or more 'sub-adapters'. | ||
− | When it receives a granule through its input connection, it will use | + | When it receives a granule through its input connection, it will use the [[Granule Acceptance|''granule acceptance'']] mechanism to decide which the most appropriate target adapter is, and it will send the granule to one (and only one) of its sub-adapters. |
The output connection of the selector serves as the 'default option': if none of the sub-adapters is prepared to accept a particular granule, then the granule is routed through the output connection of the selector. | The output connection of the selector serves as the 'default option': if none of the sub-adapters is prepared to accept a particular granule, then the granule is routed through the output connection of the selector. |
Latest revision as of 23:19, 29 December 2013
A selector is a composite adapter.
It manages a group of two or more 'sub-adapters'.
When it receives a granule through its input connection, it will use the granule acceptance mechanism to decide which the most appropriate target adapter is, and it will send the granule to one (and only one) of its sub-adapters.
The output connection of the selector serves as the 'default option': if none of the sub-adapters is prepared to accept a particular granule, then the granule is routed through the output connection of the selector.
The sub-adapters are in a sequential list; the position of a sub-adapter in the list is important.
The sub-adapters are tried out in sequence: the first adapter willing to accept a particular granule will be the one selected. Any subsequent adapters in the selector's sub-adapter list don't even get to 'see' the granule once it's routed to the selected sub-adapter.