yesod-eventsource

Server-sent events support for Yesod apps.

http://www.yesodweb.com/

Version on this page:1.4.0
LTS Haskell 22.17:1.6.0.1
Stackage Nightly 2024-04-14:1.6.0.1
Latest on Hackage:1.6.0.1

See all snapshots yesod-eventsource appears in

MIT licensed and maintained by Felipe Lessa
This version can be pinned in stack with:yesod-eventsource-1.4.0@sha256:619abf3ef9a4121ad66591237293e5847191340317a2fb41908448900427c5af,1696

Module documentation for 1.4.0

  • Yesod
    • Yesod.EventSource

It's easy to send an event from an HTTP client to a server: just send an HTTP request. However, sending events from the server to the client requires more sophisticated approaches. Server-sent events (http://www.w3.org/TR/eventsource/) are a standardized way of pushing events from the server to the client.

This package allows your Yesod application to easily send server-sent events. On the client side, you may use the EventSource JavaScript object on browsers that support it (https://developer.mozilla.org/en-US/docs/Server-sent_events/EventSource) or a polyfill for browsers that don't (we support Remy's polyfill out-of-the-box, although that requires you to explicitly support it).