=str #16652 Convert 'Working with Graphs' to java

* fixed missing or wrong javadsl
This commit is contained in:
Patrik Nordwall 2015-01-16 17:55:03 +01:00
parent 84a5505ca9
commit ed832ea7a9
6 changed files with 289 additions and 22 deletions

View file

@ -108,9 +108,16 @@ object Source {
* Creates a `Source` by using a [[FlowGraphBuilder]] from this [[PartialFlowGraph]] on a block that expects
* a [[FlowGraphBuilder]] and returns the `UndefinedSink`.
*/
def from[T](graph: PartialFlowGraph, block: japi.Function[FlowGraphBuilder, UndefinedSink[T]]): Source[T] =
def fromGraph[T](graph: PartialFlowGraph, block: japi.Function[FlowGraphBuilder, UndefinedSink[T]]): Source[T] =
new Source(scaladsl.Source(graph.asScala)(x block.apply(x.asJava).asScala))
/**
* Creates a `Source` by using a [[FlowGraphBuilder]] from on a block that expects
* a [[FlowGraphBuilder]] and returns the `UndefinedSink`.
*/
def fromGraph[T](block: japi.Function[FlowGraphBuilder, UndefinedSink[T]]): Source[T] =
new Source(scaladsl.Source()(x block.apply(x.asJava).asScala))
/**
* Creates a `Source` that is materialized to an [[akka.actor.ActorRef]] which points to an Actor
* created according to the passed in [[akka.actor.Props]]. Actor created by the `props` should