+doc explain backpressure / reactive streams a bit

This commit is contained in:
Konrad 'ktoso' Malawski 2014-12-18 18:11:32 +01:00
parent 1c722b8ae1
commit 98143e3c93
4 changed files with 88 additions and 31 deletions

View file

@ -56,11 +56,8 @@ class FlowDocSpec extends AkkaSpec {
val source = Source(1 to 10)
val sink = Sink.fold[Int, Int](0)(_ + _)
// materialize the flow
val materialized: MaterializedMap = source.to(sink).run()
// get the materialized value from the running streams MaterializedMap
val sum: Future[Int] = materialized.get(sink)
// materialize the flow, getting the Sinks materialized value
val sum: Future[Int] = source.runWith(sink)
//#materialization-runWith
}