Custom stream processing
Sometimes, all the out-of-the-box Akka Streams stages do not cover a specific scenario you need. Akka Streams provides a set of APIs to create your own custom stage. Since Streams are essentially processing graphs, to create a custom stage, you need to extend the GraphStage abstraction. Let's not confuse GraphDSL with GraphStage. The main difference between GraphDSL, which is used to compose multiple stages into a single stage, and GraphStage is that the latter cannot be decomposed into smaller pieces.
At this point, we need to learn a bit about how Akka Streams works internally. To begin with, there is the concept of shape. A shape defines the number of input and output ports in your stage (known as inlets and outlets). ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access