wai-extra-3.0.4.1: Provides some basic WAI handlers and middleware.

Safe HaskellNone
LanguageHaskell98

Network.Wai.EventSource

Description

A WAI adapter to the HTML5 Server-Sent Events API.

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.

Constructors

ServerEvent 

Fields

eventName :: Maybe Builder
 
eventId :: Maybe Builder
 
eventData :: [Builder]
 
CommentEvent 

Fields

eventComment :: Builder
 
RetryEvent 

Fields

eventRetry :: Int
 
CloseEvent 

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.