Merge pull request #17745 from akka/wip-VirtualProcessor-∂π

=str add VirtualProcessor
This commit is contained in:
Roland Kuhn 2015-06-22 11:10:01 +02:00
commit f1121d6832
24 changed files with 360 additions and 179 deletions

View file

@ -11,7 +11,6 @@ import akka.pattern.ask
import akka.stream.actor.ActorSubscriber
import akka.stream.impl.GenJunctions.ZipWithModule
import akka.stream.impl.Junctions._
import akka.stream.impl.MultiStreamInputProcessor.SubstreamSubscriber
import akka.stream.impl.StreamLayout.Module
import akka.stream.impl.fusing.ActorInterpreter
import akka.stream.impl.io.SslTlsCipherActor
@ -111,13 +110,11 @@ private[akka] case class ActorFlowMaterializerImpl(
}
}
override protected def createIdentityProcessor: Processor[Any, Any] =
processorFor(Identity(OperationAttributes.none), OperationAttributes.none, settings)._1
private def processorFor(op: StageModule,
effectiveAttributes: OperationAttributes,
effectiveSettings: ActorFlowMaterializerSettings): (Processor[Any, Any], Any) = op match {
case DirectProcessor(processorFactory, _) processorFactory()
case Identity(attr) (new VirtualProcessor, ())
case _
val (opprops, mat) = ActorProcessorFactory.props(ActorFlowMaterializerImpl.this, op, effectiveAttributes)
val processor = ActorProcessorFactory[Any, Any](actorOf(
@ -294,7 +291,7 @@ private[akka] object ActorProcessorFactory {
// Also, otherwise the attributes will not affect the settings properly!
val settings = materializer.effectiveSettings(att)
op match {
case Identity(_) (ActorInterpreter.props(settings, List(fusing.Map(_identity, settings.supervisionDecider)), materializer, att), ())
case Identity(_) throw new AssertionError("Identity cannot end up in ActorProcessorFactory")
case Fused(ops, _) (ActorInterpreter.props(settings, ops, materializer, att), ())
case Map(f, _) (ActorInterpreter.props(settings, List(fusing.Map(f, settings.supervisionDecider)), materializer, att), ())
case Filter(p, _) (ActorInterpreter.props(settings, List(fusing.Filter(p, settings.supervisionDecider)), materializer, att), ())