Hi James,
Thank you for your work on this. I have found an issue though that might be related to pull request #959.
I would like to log when SSE connections start and stop. With 2.1.1, this works:
/** Enumeratee for detecting disconnect of SSE stream */
def connDeathWatch(addr: String): Enumeratee[JsValue, JsValue] = Enumeratee.onIterateeDone{ () => println(addr + " - SSE disconnected") }
/** Controller action serving activity based on room */
def chatFeed(room: String) = Action { req =>
println(req.remoteAddress + " - SSE connected")
Ok.stream(chatOut &> filter(room) &> Concurrent.buffer(50) &> connDeathWatch(req.remoteAddress) &> EventSource()).as("text/event-stream")
}
I would get this as expected:
0:0:0:0:0:0:0:1%0 - SSE connected
0:0:0:0:0:0:0:1%0 - SSE disconnected
But with 2.1.2, the Enumeratee.onIterateeDone is not triggered when the browser window is closed. Do you have any idea what the problem could be?
Here is the whole project if you want to have a look:
You mentioned in the comments section of #959 three months ago that you'll be getting rid of ChunkedResult soon anyways. Is there any more information on this anywhere? What will the replacement be?
Thanks,
Matthias