Copyright | (c) Dave Laing 2017-2019 |
---|---|
License | BSD3 |
Maintainer | dave.laing.80@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Low level operations for integrating reflex networks with WAI
Application
s.
If you just want to serve a reflex network then have a look at Reflex.Backend.Warp.
Synopsis
- data WaiSource = WaiSource {}
- newWaiSource :: MonadIO m => m WaiSource
- waiApplicationGuest :: (Reflex t, MonadIO m, PerformEvent t m, MonadIO (Performable m), TriggerEvent t m) => WaiSource -> (Event t Request -> m (Event t Response)) -> m ()
- waiApplicationHost :: WaiSource -> Application
- liftWaiApplication :: (Reflex t, PerformEvent t m, MonadIO (Performable m), TriggerEvent t m) => Application -> Event t Request -> m (Event t Response)
- liftWaiApplicationTagged :: (Reflex t, PerformEvent t m, MonadIO (Performable m), TriggerEvent t m) => Application -> Event t (tag, Request) -> m (Event t (Map tag Response))
Documentation
The source of the WAI application data.
Requests generated by the web server are stored here, and read by the reflex network.
Responses generated by the reflex network are stored here, and read (and subsequently returned) by the web server.
waiApplicationGuest :: (Reflex t, MonadIO m, PerformEvent t m, MonadIO (Performable m), TriggerEvent t m) => WaiSource -> (Event t Request -> m (Event t Response)) -> m () Source #
waiApplicationHost :: WaiSource -> Application Source #
Build an Application
that deposits a Request
into the
WaiSource
, then reads a Response
from the WaiSource
, then
responds with it.
liftWaiApplication :: (Reflex t, PerformEvent t m, MonadIO (Performable m), TriggerEvent t m) => Application -> Event t Request -> m (Event t Response) Source #
Given a WAI Application
and a Request
event, create an
Event
that yield a Response
by running the Application
.
liftWaiApplicationTagged :: (Reflex t, PerformEvent t m, MonadIO (Performable m), TriggerEvent t m) => Application -> Event t (tag, Request) -> m (Event t (Map tag Response)) Source #
Similar to liftWaiApplication
, but the Request
event should yield
a tag which is then attached to the Response
.