[akka-user] Re: Websockets and Flow.fromSinkAndSource

2016-08-05 Thread Aditya Prasad
For anyone interested: turns out it's an error in the doc. Closing the listening side is *not* supposed to close the sending side. On Friday, July 29, 2016 at 6:28:14 PM UTC-7, Aditya Prasad wrote: > > Hi! > > I've got code like this: > >> val flow =

Re: [akka-user] Re: Websockets and Flow.fromSinkAndSource

2016-08-01 Thread Aditya Prasad
Filed an issue: https://github.com/akka/akka/issues/21089 On Monday, August 1, 2016 at 11:36:15 AM UTC-7, Aditya Prasad wrote: > > Hmm, I did, and that's why I'm asking this question :) It says: > > "The Akka HTTP WebSocket API does not support half-closed connections > which means that if the

Re: [akka-user] Re: Websockets and Flow.fromSinkAndSource

2016-08-01 Thread Aditya Prasad
Hmm, I did, and that's why I'm asking this question :) It says: "The Akka HTTP WebSocket API does not support half-closed connections which means that if the either stream completes the entire connection is closed" The problem I'm seeing is that it does NOT close the connection if only the

Re: [akka-user] Re: Websockets and Flow.fromSinkAndSource

2016-08-01 Thread Konrad Malawski
Please read the docs on this topic: http://doc.akka.io/docs/akka/2.4/scala/http/client-side/websocket-support.html#Half-Closed_WebSockets -- Konrad `ktoso` Malawski Akka @ Lightbend On 1 August 2016 at 20:17:56, Aditya Prasad (akpra...@gmail.com) wrote:

[akka-user] Re: Websockets and Flow.fromSinkAndSource

2016-08-01 Thread Aditya Prasad
tl;dr: webSocketClientFlow does not close the websocket (or shut down its input stream) when the output stream ends, but I think it's supposed to. It *does* do the reverse (shut down the output when the input terminates). On Friday, July 29, 2016 at 6:28:14 PM UTC-7, Aditya Prasad wrote: > >

[akka-user] Re: Websockets and Flow.fromSinkAndSource

2016-07-29 Thread Aditya Prasad
And just for kicks, here's my custom version of fromSinkAndSource that propagates stream termination. It's cobbled together from Akka code: def fromSinkAndSource[I, O](sink: Graph[SinkShape[I], _], source: Graph[SourceShape[O], _]): Flow[I, O, Unit] = { val p1 = Promise[Unit]() val p2 =