This is an example of a simple four stage GenStage flow. It features a multi-input stage - an adder that requires two values and computes their sum. For a more detailed explanation, please see this blog post
The example is meant to illustrate how to:
- design a multi-input stage, and
- allow for the uneven appearances of input events.
Two examples of flows are possible - see the comments for directions:
- Two Constant stages feed a Sum stage whose output is asked for by a Timer stage.
- Two enumerated flows feed a Sum stage whose output is asked for by a Timer stage.
- cd genstage_example_2
- mix deps.get
- mix run lib/genstage_example_2.exs