
5 Jan
2012
5 Jan
'12
3:25 p.m.
On Thu, Jan 5, 2012 at 10:40 AM, Johannes Waldmann
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 use HaXR in conjunction with Snap. It basically boils down to using Network.XmlRpc.Server (handleCall, methods) in conjunction with Snap's getRequestBody and writeLBS. The good news is you don't need to worry about forking your own threads, the web server handles that. To make calls stateful, you just stash away a reference in the handler you give Snap (or whatever web server you use). Anthony