Hi,
you are applying the `alsoTo` clause to the wrong side of the connection.
You need to put it on the Sink-side. The way you have written it, the
`alsoTo` clause waits for your `Source.actorRef` to close the connection.
Try using
singleWebSocketRequest(...,
Hello!
I also can't get flow.alsoTo(Sink.onComplete(...)) to trigger. The only
thing that completes when the websocket closes (due to timeout) is the
materialized Future[Done] from the Flow.
In addition, the pattern to use for reconnection logic becomes unclear
because the websocket flow is
source
.viaMat(
Http().webSocketClientFlow(
WebSocketRequest(
host + "/console")
)
)(Keep.both)
.alsoTo(Sink.onComplete(_ => {
self ! RestartWebsocket
}))
.toMat(sink)(Keep.left)
.run()
--
>> Read the docs: http://akka.io/docs/
>>