System wide materializer (#27491)

Introduces a materializer started through an extension and then an implicit
conversion for Scala turning an implicitly available ActorSystem into a
materializer. The Java APIs has been ammended with run-methods accepting
an ActorSystem.
This commit is contained in:
Johan Andrén 2019-08-23 18:19:27 +02:00 committed by GitHub
parent 77d1d33dbc
commit 45c826a218
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
196 changed files with 1148 additions and 1129 deletions

View file

@ -18,7 +18,6 @@ class FlowErrorDocSpec extends AkkaSpec {
"demonstrate fail stream" in {
//#stop
implicit val materializer = ActorMaterializer()
val source = Source(0 to 5).map(100 / _)
val result = source.runWith(Sink.fold(0)(_ + _))
// division by zero will fail the stream and the
@ -48,7 +47,6 @@ class FlowErrorDocSpec extends AkkaSpec {
"demonstrate resume section" in {
//#resume-section
implicit val materializer = ActorMaterializer()
val decider: Supervision.Decider = {
case _: ArithmeticException => Supervision.Resume
case _ => Supervision.Stop
@ -69,7 +67,6 @@ class FlowErrorDocSpec extends AkkaSpec {
"demonstrate restart section" in {
//#restart-section
implicit val materializer = ActorMaterializer()
val decider: Supervision.Decider = {
case _: IllegalArgumentException => Supervision.Restart
case _ => Supervision.Stop
@ -91,7 +88,6 @@ class FlowErrorDocSpec extends AkkaSpec {
}
"demonstrate recover" in {
implicit val materializer = ActorMaterializer()
//#recover
Source(0 to 6)
.map(n =>
@ -117,7 +113,6 @@ stream truncated
}
"demonstrate recoverWithRetries" in {
implicit val materializer = ActorMaterializer()
//#recoverWithRetries
val planB = Source(List("five", "six", "seven", "eight"))