!str #19732 Concise and consistent way to mark async boundaries

This commit is contained in:
Johan Andrén 2016-02-10 13:56:38 +01:00
parent d154fad4e9
commit 4e49d75ad8
25 changed files with 125 additions and 194 deletions

View file

@ -237,11 +237,8 @@ class FlowDocSpec extends AkkaSpec {
"defining asynchronous boundaries" in {
//#flow-async
import akka.stream.Attributes.asyncBoundary
Source(List(1, 2, 3))
.map(_ + 1)
.withAttributes(asyncBoundary)
.map(_ + 1).async
.map(_ * 2)
.to(Sink.ignore)
//#flow-async

View file

@ -23,6 +23,11 @@ class MigrationsScala extends AkkaSpec {
})
})
//#expand-state
//#async
val flow = Flow[Int].map(_ + 1)
Source(1 to 10).via(flow.async)
//#async
}
}
}