Created
May 20, 2016 14:55
-
-
Save johanandren/631c9fdf7933fed7fd2bd6fdd15e11a0 to your computer and use it in GitHub Desktop.
Does the stages inherit the materializer strategy?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package streams | |
import akka.actor.ActorSystem | |
import akka.stream.ActorAttributes.SupervisionStrategy | |
import akka.stream.Supervision.Resume | |
import akka.stream._ | |
import akka.stream.scaladsl.Source | |
import akka.stream.stage.{GraphStage, GraphStageLogic} | |
object ActorMaterializerSettingsApp extends App { | |
implicit val system = ActorSystem() | |
implicit val mat = ActorMaterializer( | |
ActorMaterializerSettings(system).withSupervisionStrategy(Supervision.restartingDecider: Supervision.Decider) | |
) | |
class Test extends GraphStage[SourceShape[String]] { | |
val out = Outlet[String]("ba") | |
val shape = SourceShape.of(out) | |
override def createLogic(inheritedAttributes: Attributes): GraphStageLogic = new GraphStageLogic(shape) { | |
println(inheritedAttributes.get[SupervisionStrategy] eq Supervision.restartingDecider) | |
} | |
} | |
Source.fromGraph(new Test).runForeach(println) | |
system.terminate() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment