我尝试了(http://www.http-kit.org/server.html#async)的基本示例,但是如果我curl到端点,那么在连接关闭之后,我会立即得到所有的消息(而不是每200 is获得一次,因为它在浏览器中工作)。到底怎么回事?
我也尝试过这样做:
(schedule-task (* id 200) ;; send a message every 200ms
(send! channel
{:status 200
:headers {"Content-Type" "text/event-stream"
"Connection" "keep-alive"}
:body (str "message from server #" id)}
false)) ; false => don't close after send行为是一样的。
发布于 2015-11-11 14:17:29
似乎是卷发和流http的问题。据这 post称,选项的顺序很重要
另外,尝试使用-N -无缓冲区选项
https://stackoverflow.com/questions/33652380
复制相似问题