[−][src]Function warp::filters::sse::sse
pub fn sse() -> impl Filter<Extract = (Sse,), Error = Rejection> + Copy
Creates a Server-sent Events filter.
The yielded Sse
is used to reply with stream of events.
Note
This filter combines multiple filters internally, so you don't need them:
- Method must be
GET
- Header
connection
must bekeep-alive
when it present.
If the filters are met, yields a Sse
. Calling Sse::reply
will return
a reply with:
- Status of
200 OK
- Header
content-type: text/event-stream
- Header
cache-control: no-cache
.