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


-- | Server-sent events support for Yesod apps.
--   
--   API docs and the README are available at
--   <a>http://www.stackage.org/package/yesod-eventsource</a>
@package yesod-eventsource
@version 1.6.0


-- | This module contains everything that you need to support server-sent
--   events in Yesod applications.
module Yesod.EventSource

-- | Returns a Server-Sent Event stream from a <a>Source</a> of
--   <a>ServerEvent</a><tt>s</tt>. The HTTP socket is flushed after every
--   event. The connection is closed either when the <a>Source</a> finishes
--   outputting data or a <a>CloseEvent</a> is outputted, whichever comes
--   first.
repEventSource :: (EventSourcePolyfill -> ConduitT () ServerEvent (HandlerFor site) ()) -> HandlerFor site TypedContent

-- | Return a Server-Sent Event stream given a <a>HandlerT</a> action that
--   is repeatedly called. A state is threaded for the action so that it
--   may avoid using <tt>IORefs</tt>. The <tt>HandlerT</tt> action may
--   sleep or block while waiting for more data. The HTTP socket is flushed
--   after every list of simultaneous events. The connection is closed as
--   soon as an <a>CloseEvent</a> is outputted, after which no other events
--   are sent to the client.
pollingEventSource :: s -> (EventSourcePolyfill -> s -> HandlerFor site ([ServerEvent], s)) -> HandlerFor site TypedContent

-- | Return a Server-Sent Event stream given an <tt>IO</tt> action that is
--   repeatedly called. A state is threaded for the action so that it may
--   avoid using <tt>IORefs</tt>. The <tt>IO</tt> action may sleep or block
--   while waiting for more data. The HTTP socket is flushed after every
--   list of simultaneous events. The connection is closed as soon as an
--   <a>CloseEvent</a> is outputted, after which no other events are sent
--   to the client.
ioToRepEventSource :: s -> (EventSourcePolyfill -> s -> IO ([ServerEvent], s)) -> HandlerFor site TypedContent

-- | Which <tt>EventSource</tt> polyfill was detected (if any).
data EventSourcePolyfill

-- | We didn't detect any <tt>EventSource</tt> polyfill that we know.
NoESPolyfill :: EventSourcePolyfill

-- | See
--   <a>https://github.com/remy/polyfills/blob/master/EventSource.js</a>.
--   In order to support Remy's polyfill, your server needs to explicitly
--   close the connection from time to time--browsers such as IE7 will not
--   show any event until the connection is closed.
Remy'sESPolyfill :: EventSourcePolyfill
instance GHC.Enum.Enum Yesod.EventSource.EventSourcePolyfill
instance GHC.Show.Show Yesod.EventSource.EventSourcePolyfill
instance GHC.Classes.Ord Yesod.EventSource.EventSourcePolyfill
instance GHC.Classes.Eq Yesod.EventSource.EventSourcePolyfill
