Closed refactor closed 6 years ago
it's ok for gun:flush(...) used in console, but when using flush(..) in program code, it may miss the message.
` StreamRef = gun:put(ConnPid, <<"/", Index/binary>>, [], Body),
{response, nofin, 200, _Headers} = gun:await(ConnPid, StreamRef), gun:flush(StreamRef), ... `
I guess 'receive after 0' make gun:flush(...) miss the gun message.
You have to cancel the stream first.
noop, cancel doesn't work in this situation, gun:cancel(ConnPid, StreamRef) just send a message to ConnPid. anyway it's not a big deal, just use gun:await_body to get round.
it's ok for gun:flush(...) used in console, but when using flush(..) in program code, it may miss the message.
` StreamRef = gun:put(ConnPid, <<"/", Index/binary>>, [], Body),
{response, nofin, 200, _Headers} = gun:await(ConnPid, StreamRef), gun:flush(StreamRef), ... `
I guess 'receive after 0' make gun:flush(...) miss the gun message.