To maybe further elaborate on what I've attempted...

I read a response 
<http://stackoverflow.com/questions/35795258/akka-websocket-server-push-in-java>
 
that the gist of being able to 'server push' a message to a client was to 
first "do an ActorPublisher to push the msg to client, then create a flow 
which uses the ActorPublisher as a source and pass this flow to the 
handleWebSocketMessages. Then, to push messages to the client you can use 
the ActorRef of the ActorPublisher and do a .tell(msg)". I've tried 
implementing this in such that I have followed what was described as best 
as I could, but issue arise immediately (such as no way to get the ActorRef 
to do a .tell). It's possible I am not creating the ActorPublisher 
correctly (when they say to "push the msg to the client" I'm assuming 
that's an onNext call but not sure).

This ActorRef.tell(msg) sounds pretty much like what I need, a very basic 
way to get the result from my analysis and send it along the websocket to 
the client.

On Friday, April 21, 2017 at 12:15:33 PM UTC-5, Andrew Schenck wrote:

> Hello all,
>
> I have scoured the questions raised here that are similar to my needs but 
> so far have not been successful at finding a solution.
>
> I need (want) to be able to create an akka websocket server in which I can 
> send messages from the server to the clients connected (for example, send 
> the outputs from a flink analytic along the websocket to an end user GUI). 
> I was able to implement the request-response example, but so far have had 
> little success in a 'server push' model.
>
> Using something like jetty it is as easy as ws.broadcast, but I understand 
> akka needs to use backpressure etc, soI guess what I am stumbling with is 
> how to create a proper flow in a 'server-push' model, in *java*. 
>
> If there are examples I can look at (haven't found any) or some literature 
> I can read or any suggestions as to how to create this 'server-push' 
> websocket model it would be greatly appreciated.
>
> Thanks for the help,
>
> Andy
>

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