wai-eventsource-1.3.0: WAI support for server-sent events

Safe HaskellSafe-Infered

Network.Wai.EventSource

Synopsis

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 -> ApplicationSource

Make a new WAI EventSource application reading events from the given channel.

eventSourceAppSource :: Source (ResourceT IO) ServerEvent -> ApplicationSource

Make a new WAI EventSource application reading events from the given source.

eventSourceAppIO :: IO ServerEvent -> ApplicationSource

Make a new WAI EventSource application reading events from the given IO action.

sourceToSource :: Monad m => Source m ServerEvent -> Source m (Flush Builder)Source

Convert a ServerEvent source into a Builder source of serialized events.