Hello, Within the iteratee enumerator you use to send the data, it should be possible to use catchError and/or the MonadCatchIO typeclass instance to attach a "finally" handler to your code.
Thanks, G On Sun, Jan 23, 2011 at 10:48 PM, tsuraan <[email protected]> wrote: > I've written a long-poll HTTP server using haskell and mongrel2, and > now I'm trying to work out how to do one using Snap. When doing a > long-polling HTTP server, it's expected for client sockets to stick > around for a long time before getting responses. This makes it really > likely that a user will close their browser before I've replied to > them. Is there a way that I can detect a client hangup from my snap > Application and tear down the forkIO thread and other resources that > are waiting for a message from the message queues? Otherwise, the > forkIO and associated resources will stick around until a message is > delivered to the (now disconnected) browser, which can be a very long > time, and is a waste of resources at that point. > _______________________________________________ > Snap mailing list > [email protected] > http://mailman-mail5.webfaction.com/listinfo/snap > -- Gregory Collins <[email protected]> _______________________________________________ Snap mailing list [email protected] http://mailman-mail5.webfaction.com/listinfo/snap
