February 2018
Intermediate to advanced
552 pages
13h 46m
English
In the Akka Streams API, Source is a Producer of streaming data and has only one output and no input.
The main responsibility of a Source is producing data elements (or emitting data elements) to Sink or Flow when it's ready to receive them. Here, we can call Source the upstream processing stage and Sink the downstream processing stage.
A Source can have either only one step or a set of stream-processing steps, depending on our requirements. A Source can be anything like a File, String, Collection, Map, Database, and so on.
In the Akka Streams API, a Source is defined as a final class in the akka.stream.scaladsl package, as shown here:
final class Source[+Out, +Mat] {
// Only Out (Output)
}
Akka Materialization ...
Read now
Unlock full access