Reputation: 9878
I want something like this
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent (threadDelay)
import Control.Monad.IO.Class
import Snap.Core
import Snap.Http.Server
main :: IO ()
main = quickHttpServe site
site :: Snap ()
site = do
writeBS "testing\n"
liftIO $ threadDelay (1000 * 1000 * 5)
writeBS "one two three"
Except that I want to flush the response right after writing testing\n
. Should be simple but my googling skills are failing me.
Upvotes: 2
Views: 36