Network.Wai.EventSource.EventStream

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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Network.Wai.EventSource.EventStream

Description

Internal module, usually you don't need to use it.

Synopsis

- data ServerEvent
  - = ServerEvent {
    - eventName :: Maybe Builder
    - eventId :: Maybe Builder
    - eventData :: [Builder]
    }
  - | CommentEvent {
    - eventComment :: Builder
    }
  - | RetryEvent {
    - eventRetry :: Int
    }
  - | CloseEvent
- eventToBuilder :: ServerEvent -> Maybe Builder

# Documentation

data ServerEvent #

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 |

eventToBuilder :: ServerEvent -> Maybe Builder #

Converts a `ServerEvent` to its wire representation as specified by the `text/event-stream` content type.