=str #15755 #15756 First stab at input/output factories

* New naming based on Source and Sink
This commit is contained in:
Patrik Nordwall 2014-09-01 13:12:18 +02:00
parent 0df3f572e1
commit 0046bebdfe
10 changed files with 306 additions and 209 deletions

View file

@ -15,6 +15,7 @@ import akka.actor.ActorContext
import akka.stream.impl2.StreamSupervisor
import akka.stream.impl2.FlowNameCounter
import akka.stream.MaterializerSettings
import org.reactivestreams.Processor
object FlowMaterializer {
@ -22,8 +23,7 @@ object FlowMaterializer {
* Scala API: Creates a FlowMaterializer which will execute every step of a transformation
* pipeline within its own [[akka.actor.Actor]]. The required [[akka.actor.ActorRefFactory]]
* (which can be either an [[akka.actor.ActorSystem]] or an [[akka.actor.ActorContext]])
* will be used to create these actors, therefore it is *forbidden* to pass this object
* to another actor if the factory is an ActorContext.
* will be used to create one actor that in turn creates actors for the transformation steps.
*
* The `namePrefix` is used as the first part of the names of the actors running
* the processing steps. The default `namePrefix` is `"flow"`. The actor names are built up of
@ -49,8 +49,7 @@ object FlowMaterializer {
* Java API: Creates a FlowMaterializer which will execute every step of a transformation
* pipeline within its own [[akka.actor.Actor]]. The required [[akka.actor.ActorRefFactory]]
* (which can be either an [[akka.actor.ActorSystem]] or an [[akka.actor.ActorContext]])
* will be used to create these actors, therefore it is *forbidden* to pass this object
* to another actor if the factory is an ActorContext.
* will be used to create one actor that in turn creates actors for the transformation steps.
*/
def create(settings: MaterializerSettings, context: ActorRefFactory): FlowMaterializer =
apply(settings)(context)
@ -75,7 +74,12 @@ abstract class FlowMaterializer(val settings: MaterializerSettings) {
* INTERNAL API
* ops are stored in reverse order
*/
private[akka] def toPublisher[I, O](publisherNode: Ast.PublisherNode[I], ops: List[Ast.AstNode]): Publisher[O]
private[akka] def materialize[In, Out](source: Source[In], sink: Sink[Out], ops: List[Ast.AstNode]): MaterializedFlow
/**
* INTERNAL API
*/
private[akka] def identityProcessor[I](flowName: String): Processor[I, I]
}