Reputation: 3974
I tried out the basic example for HTTP streaming of HTTP-Kit (http://www.http-kit.org/server.html#async), but if I curl
to the endpoint I get all the messages at once, after the connection is closed (instead of getting them every 200ms, as it works in the browser). What's going on?
I also tried it like this:
(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
The behaviour is the same.
Upvotes: 0
Views: 269