I have the following code:

val cmdSrc: Source[Message, ActorRef] = Source.actorRef[Message](10, 
OverflowStrategy.fail)

val wsr: WebSocketRequest = WebSocketRequest(myEndpoint)

val webSocketFlow: Flow[Message, Message, Future[WebSocketUpgradeResponse]] 
= Http().webSocketClientFlow(wsr)

val webSocketGraph: RunnableGraph[(ActorRef, Future[Done])] = 
cmdSrc.via(webSocketFlow).toMat(printSink)(Keep.both)

val (actorRef, fd): (ActorRef, Future[Done]) = webSocketGraph.run()



The idea is that I want to send messages to actorRef that are then sent 
through the flow.

This code produces the required result, but its an early and amateurish 
attempt as I try to understand Akka.

My questions are:

   - Is this somewhere near the accepted idiom, or is there a better 
   representation of the same thing?
   - How do I get my hands on the Future[WebSocketUpgradeResponse] from 
   webSocketFlow (line 3)?

Thanks!

-- 
>>>>>>>>>>      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