[Haskell-cafe] haxr standalone server?

Michael Snoyman michael at snoyman.com
Fri Jan 6 11:44:34 CET 2012


On Thu, Jan 5, 2012 at 5:40 PM, Johannes Waldmann
<waldmann at imn.htwk-leipzig.de> wrote:
> How could I use haxr (http://www.haskell.org/haskellwiki/HaXR)
> to build a stateful server?
>
> It should listen on some port,
> and fork threads (inside Haskell land) to handle incoming calls.
> Any of the Haskell web frameworks can do this?
>
> I guess this is the same question as:
> http://www.haskell.org/pipermail/haskell-cafe/2009-December/071185.html

Just an FYI for everyone. Johannes and I discussed this a bit
off-list, and decided that the wai-frontend-monadcgi package would be
a good fit for this use case. I deprecated this package because
MonadCGI requires lazy I/O for the request body, and enumerator-based
WAI 0.4 cannot provide a lazy request body[1]. However, WAI 1.0 will
be based on conduits, which does allow lazy I/O. I've added the
wai-frontend-monadcgi to the wai repository[2] and will release it
when the rest of WAI 1.0 is released.

Michael

[1] Without resorting to hacks like forking a separate thread and
piping data through a Chan.
[2] https://github.com/yesodweb/wai



More information about the Haskell-Cafe mailing list