Safe Haskell | None |
---|---|
Language | Haskell2010 |
A WAI adapter to the HTML5 Server-Sent Events API.
If running through a proxy like Nginx you might need to add the headers:
[ ("X-Accel-Buffering", "no"), ("Cache-Control", "no-cache")]
- data ServerEvent
- = ServerEvent { }
- | CommentEvent { }
- | RetryEvent {
- eventRetry :: Int
- | CloseEvent
- eventSourceAppChan :: Chan ServerEvent -> Application
- eventSourceAppIO :: IO ServerEvent -> Application
Documentation
data ServerEvent Source #
Type representing a communication over an event stream. This can be an actual event, a comment, a modification to the retry timer, or a special "close" event indicating the server should close the connection.
eventSourceAppChan :: Chan ServerEvent -> Application Source #
Make a new WAI EventSource application reading events from the given channel.
eventSourceAppIO :: IO ServerEvent -> Application Source #
Make a new WAI EventSource application reading events from the given IO action.