Thanks Arnaud!

The key is in this line

  
https://github.com/jrudolph/akka-http-scala-js-websocket-chat/blob/239af857da2f174ea1624a84b0861c42cf4d1f2d/backend/src/main/scala/example/akkawschat/Webservice.scala#L33

so on the server side, the REST endpoint upgrades to a WebSocket `Flow` 
(i.e. akka streams API) via a directive.

My legacy code is just an Actor, so I'll have to reimplement my marshalling 
layer and so on around this (or maybe marshalling is already handled).

I've had a look at the Akka Streams documentation but it is not clear to me 
how to manually create a Flow from an Actor. I may have to read this a few 
more times, but I don't think it contains the information that I need... 
there doesn't appear to be a `Flow.actorRef`

http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC3/scala/stream-integrations.html



On Saturday, 23 May 2015 18:49:26 UTC+1, Arnaud Gourlay wrote:
>
> Hi Sam,
>
> I am also really interested in migrating from Wandoulabs to the new Akka 
> WS implementation.
> So far this is the best example I could find 
> https://github.com/jrudolph/akka-http-scala-js-websocket-chat
>
> Hope this helps,
> Arnaud
>
> On Saturday, May 23, 2015 at 12:38:22 PM UTC+2, Sam Halliday wrote:
>>
>> Hi all,
>>
>> I'm very excited that akka-io now has WebSocket support.
>>
>> In ENSIME, we're planning on using this wrapper over wandoulab's 
>> websockets
>>
>>   https://github.com/smootoo/simple-spray-websockets
>>
>> to easily create a REST/WebSockets endpoint with JSON marshalling for a 
>> sealed family, with backpressure.
>>
>> Smootoo's wrapper works really well, and I have had the pleasure of using 
>> it in a corporate environment so I trust it to be stable.
>>
>>
>> For future proofing, it would seem sensible to move to stock akka-io for 
>> WebSockets, so I'm considering sending a PR to retrofit the wrapper. I have 
>> a couple of questions about that:
>>
>> 1. does akka-io's HTTP singleton actor support WebSockets now? That was 
>> the big caveat about using wandoulabs. It means all kinds of workarounds if 
>> you want to just use HTTP in the same actor system.
>>
>> 2. is there a migration guide for wandoulabs to akka-io? Or would it be 
>> best just to rewrite the wrapper from scratch on top of akka-io?
>>
>> 3. where is the documentation? This just has a big TODO on it
>>
>>   
>> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC3/scala/http/client-side/websocket-support.html
>>   
>> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-RC3/scala/http/routing-dsl/websocket-support.html
>>
>> I can't even find any examples. I guess the key thing is the handshaking, 
>> which would mean rewriting this bit (and the corresponding client side 
>> handshake)
>>
>>   
>> https://github.com/smootoo/simple-spray-websockets/blob/master/src/main/scala/org/suecarter/websocket/WebSocket.scala#L167
>>
>> Best regards,
>> Sam
>>
>

-- 
>>>>>>>>>>      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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to