The Java graph DSL isn’t that different, the squiggly arrows (~>) corresponds 
to builder.via and you might
need to manually perform some more builder.add calls to add stages than the 
Scala code does, but you
should be able to create something pretty much like it with Java.

The docs on the Java GraphDSL can be found here:
http://doc.akka.io/docs/akka/2.4.2-RC2/java/stream/stream-graphs.html 
<http://doc.akka.io/docs/akka/2.4.2-RC2/java/stream/stream-graphs.html>

In the sample I gave you the Flow<Message, Message, ?> is created by first 
returning a FlowShape from the
block that creates the graph (in Scala the last value is returned, no return 
statement needed), and then passing the
resulting Graph<FlowShape<Message, Message,…>> to Flow.fromGraph.

If it wasn’t for the fact that we needed to pass the outgoing message actorref 
to the connection-actor we could
have just used Flow.fromSinkAndSource(sink, source) to construct it.

—
Johan Andrén
Typesafe -  Reactive apps on the JVM
Twitter: @apnylle

> 9 feb. 2016 kl. 13:51 skrev ash.ta <ata...@gmail.com>:
> 
> hey johan,
> 
> thanks for explanation.
> my main problem is that i don't know scala and the example is pretty much 
> gibberish for me.
> can you give me a hint about the flow point where sink and source can be 
> called with actorref creation?
> i mean, your java example shows 
> handleWebsocketMessages()
> 
> which receives a mthode returning 
> 
> Flow<Message, Message, ?>
> 
> where and how sink and source can be bound to this flow?
> 
> thanks again.
> 
> 
>  
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
> >>>>>>>>>> <https://groups.google.com/group/akka-user>
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Akka User List" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/akka-user/qWw79unk_tw/unsubscribe 
> <https://groups.google.com/d/topic/akka-user/qWw79unk_tw/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> akka-user+unsubscr...@googlegroups.com 
> <mailto:akka-user+unsubscr...@googlegroups.com>.
> To post to this group, send email to akka-user@googlegroups.com 
> <mailto:akka-user@googlegroups.com>.
> Visit this group at https://groups.google.com/group/akka-user 
> <https://groups.google.com/group/akka-user>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to