servant-0.20.3.0: A family of combinators for defining webservices APIs

Safe Haskell | None
Language | Haskell2010

Servant.API.ServerSentEvents

Description

Server-sent events

See https://www.w3.org/TR/2009/WD-eventsource-20090421/.

Synopsis

- data ServerSentEvents' (method :: k) (status :: Nat) (kind :: EventKind) a
- type ServerSentEvents = ServerSentEvents' 'GET 200
- data EventKind
  - = RawEvent
  - | JsonEvent

# Documentation

data ServerSentEvents' (method :: k) (status :: Nat) (kind :: EventKind) a Source #

Server-sent events (SSE)

See https://www.w3.org/TR/2009/WD-eventsource-20090421/.

#### Instances

Instances details

Generic (ServerSentEvents' method status kind a) Source # |

Instance details

Defined in Servant.API.ServerSentEvents

Associated Types

type Rep (ServerSentEvents' method status kind a) |
Instance details Defined in Servant.API.ServerSentEvents type Rep (ServerSentEvents' method status kind a) = D1 ('MetaData "ServerSentEvents'" "Servant.API.ServerSentEvents" "servant-0.20.3.0-FHJyKhVqWFv2rTftFmLybU" 'False) (V1 :: Type -> Type)

Methods

from :: ServerSentEvents' method status kind a -> Rep (ServerSentEvents' method status kind a) x Source #

to :: Rep (ServerSentEvents' method status kind a) x -> ServerSentEvents' method status kind a Source #

type Rep (ServerSentEvents' method status kind a) Source # |
Instance details Defined in Servant.API.ServerSentEvents type Rep (ServerSentEvents' method status kind a) = D1 ('MetaData "ServerSentEvents'" "Servant.API.ServerSentEvents" "servant-0.20.3.0-FHJyKhVqWFv2rTftFmLybU" 'False) (V1 :: Type -> Type)

type ServerSentEvents = ServerSentEvents' 'GET 200 Source #

data EventKind Source #

Determines the shape of events you may receive (i.e. the `a` in 'ServerSentEvents'')

Constructors

RawEvent | `EventMessage` or `Event` `ByteString`
JsonEvent | Anything that implements `FromJSON`