Stream - (Software|Library)
Table of Contents
About
Software, Library around the notion of stream
Articles Related
Distributed stream processing
Distributed stream processing frameworks such as:
- Samza - Linkedin,
- Storm - team (Yahoo!)
- StreamSet Connected car demo
- Apache Spark (Micro batch)
IO - built-in streams
These streams are built into the application itself: IO - Standard streams (stdin, stdout, stderr)
Example
Node.js
Node.js stream uses the pipe function to connect the source to the destination
src.pipe(dst)
<wrap box>.pipe(dst)</note> returns <wrap box>dst</note> so that you can chain together multiple <wrap box>.pipe</note> calls together:
a.pipe(b).pipe(c).pipe(d)
which is the same as:
a.pipe(b);
b.pipe(c);
c.pipe(d);
which is the same as with the shell command-line pipe:
a | b | c | d
Java
Java Stream (Map reduce implementation, only one source then)
int sum = widgets.stream()
.filter(b -> b.getColor() == RED)
.mapToInt(b -> b.getWeight())
.sum();