Closed binarylogic closed 5 years ago
Aha, interesting, I see async: :once
would tell it to only read receive once:
Note 1: When {async, once} is used the socket will receive only once. To receive the other messages use the function hackney:stream_next/1.
I assume there was still data left on the socket?
Does this have any implications for keep-alive / http pipelining?
Yeah, I spoke with @mitchellhenke about this yesterday, apparently this is meant to be manually read / closed. You need to use :hackney.stream_next/1
and :hackney.async_stop/1
when you're done. I still prefer this new method since what's outline here has more opportunity for failure and missed cleanup.
Gotcha :+1:
This fixes a memory issue with a dependency library (
:hackney
) where setting theasync: :once
option causes memory to continually grow. Usingasync: true
does not have this same effect.