-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | WAI support for server-sent events
--   
--   WAI support for server-sent events
@package wai-eventsource
@version 1.3.0.4

-- | Internal module, usually you don't need to use it.
module Network.Wai.EventSource.EventStream

-- | 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.
data ServerEvent
ServerEvent :: Maybe Builder -> Maybe Builder -> [Builder] -> ServerEvent
eventName :: ServerEvent -> Maybe Builder
eventId :: ServerEvent -> Maybe Builder
eventData :: ServerEvent -> [Builder]
CommentEvent :: Builder -> ServerEvent
eventComment :: ServerEvent -> Builder
RetryEvent :: Int -> ServerEvent
eventRetry :: ServerEvent -> Int
CloseEvent :: ServerEvent

-- | Converts a ServerEvent to its wire representation as specified
--   by the text/event-stream content type.
eventToBuilder :: ServerEvent -> Maybe Builder

-- | A WAI adapter to the HTML5 Server-Sent Events API.
module Network.Wai.EventSource

-- | 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.
data ServerEvent
ServerEvent :: Maybe Builder -> Maybe Builder -> [Builder] -> ServerEvent
eventName :: ServerEvent -> Maybe Builder
eventId :: ServerEvent -> Maybe Builder
eventData :: ServerEvent -> [Builder]
CommentEvent :: Builder -> ServerEvent
eventComment :: ServerEvent -> Builder
RetryEvent :: Int -> ServerEvent
eventRetry :: ServerEvent -> Int
CloseEvent :: ServerEvent

-- | Make a new WAI EventSource application reading events from the given
--   channel.
eventSourceAppChan :: Chan ServerEvent -> Application

-- | Make a new WAI EventSource application reading events from the given
--   source.
eventSourceAppSource :: Source (ResourceT IO) ServerEvent -> Application

-- | Make a new WAI EventSource application reading events from the given
--   IO action.
eventSourceAppIO :: IO ServerEvent -> Application

-- | Convert a ServerEvent source into a Builder source of serialized
--   events.
sourceToSource :: Monad m => Source m ServerEvent -> Source m (Flush Builder)
