Working with graphs
Streams are ultimately graphs. Stages can be seen as graph nodes with a certain number of input and output ports, and streams define how these nodes are connected. Akka Streams brings a GraphDSL
to design your streams in a more intuitive way. This GraphDSL
can be used for multiple purposes:
- Design and compose complicated stages that would act as unique stages. These stages will also be reusable.
- Design runnable graphs.
A runnable graph is a type of stream where there is at least one Source and one Sink and all the ports of all the stages are connected. There are built-in stages available to combine different streams. The most common junction stages are as follows:
Merge
: This is a stage with n input ports and one output port. It merges all the incoming elements from the input with the output.Balance
: This is a stage with one input port and n output port. It distributes incoming elements to output ports based on demand.Broadcast
: This is a stage with one input port and n output...