Play! 2 WS library : Detect and handle closed connection in streaming http
response
In the play WS library, I am using this call to process a streaming http
response:
def get[A](consumer: ResponseHeaders => Iteratee[Array[Byte], A]):
Future[Iteratee[Array[Byte], A]]
I am passing it something like: _ => (Iteratee.foreach(chunk =>
println(chunk)))
Everything works fine, but at some point the connection seems to close and
I don't know how to handle this. I tried adding .mapDone to print out some
stuff when the Iteratee is done, but it never happens.
On this get request, how can I detect that the connection has been closed
and handle that event?
No comments:
Post a Comment