=str #16652 Convert 'Working with Graphs' to java
* fixed missing or wrong javadsl
This commit is contained in:
parent
84a5505ca9
commit
ed832ea7a9
6 changed files with 289 additions and 22 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue