-str - Improvements and renames in internal streams classes

* Renames Module.grow -> Module.compose
 * Renames Module.connect -> Module.wire
 * Renames Module.growConnect -> Module.fuse
 * Renames Module.wrap -> Module.nest

 * Adds explicit identity equals and hashCode to InPort and OutPort

 * Reimplements many of the Source factories to avoid copying

 * Documents Module.compose, Module.fuse, Module.wire and Module.nest

 * Removes Attributes.nameLifted

 * Optimizes Attributes.nameOrDefault
This commit is contained in:
Viktor Klang 2015-07-06 22:00:21 +02:00
parent efc659b70a
commit 66a116d3d2
19 changed files with 333 additions and 290 deletions

View file

@ -68,7 +68,7 @@ private[akka] case class ActorMaterializerImpl(
override def materialize[Mat](runnableGraph: Graph[ClosedShape, Mat]): Mat = {
if (haveShutDown.get())
throw new IllegalStateException("Attempted to call materialize() after the ActorMaterializer has been shut down.")
if (StreamLayout.Debug) runnableGraph.module.validate()
if (StreamLayout.Debug) StreamLayout.validate(runnableGraph.module)
val session = new MaterializerSession(runnableGraph.module) {
private val flowName = createFlowName()
@ -299,8 +299,6 @@ private[akka] object ActorProcessorFactory {
val settings = materializer.effectiveSettings(att)
def interp(s: Stage[_, _]): (Props, Unit) = (ActorInterpreter.props(settings, List(s), materializer, att), ())
op match {
case Identity(_) throw new AssertionError("Identity cannot end up in ActorProcessorFactory")
case Fused(ops, _) (ActorInterpreter.props(settings, ops, materializer, att), ())
case Map(f, _) interp(fusing.Map(f, settings.supervisionDecider))
case Filter(p, _) interp(fusing.Filter(p, settings.supervisionDecider))
case Drop(n, _) interp(fusing.Drop(n))
@ -328,6 +326,7 @@ private[akka] object ActorProcessorFactory {
val s_m = mkStageAndMat()
(ActorInterpreter.props(settings, List(s_m._1), materializer, att), s_m._2)
case DirectProcessor(p, m) throw new AssertionError("DirectProcessor cannot end up in ActorProcessorFactory")
case Identity(_) throw new AssertionError("Identity cannot end up in ActorProcessorFactory")
}
}