reflex-backend-wai-0.1.0.0: Reflex interface to `wai`

Copyright(c) Dave Laing 2017-2019
LicenseBSD3
Maintainerdave.laing.80@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Reflex.Backend.Wai

Description

Low level operations for integrating reflex networks with WAI Applications.

If you just want to serve a reflex network then have a look at Reflex.Backend.Warp.

Synopsis

Documentation

data WaiSource Source #

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 #

Build a reflex network that pumps Requests and Responses to and from the WaiSource

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.

The output Event will fire some time after the input Event.

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.