keter/test/app.hs

23 lines
636 B
Haskell
Raw Normal View History

2012-05-11 08:38:05 +04:00
{-# LANGUAGE OverloadedStrings #-}
import Keter.TempFolder
import Keter.App
import qualified Keter.Nginx as N
import Data.Default
import Control.Concurrent
import System.Directory (copyFile)
main :: IO ()
main = do
tf <- setup "temp"
nginx <- N.start def
copyFile "incoming/foo1.keter" "incoming/foo.keter"
(app, toRun) <- start tf nginx "incoming/foo.keter" $ putStrLn "It's dead Jim"
toRun
threadDelay $ 2 * 1000 * 1000
copyFile "incoming/foo2.keter" "incoming/foo.keter"
reload app
threadDelay $ 2 * 1000 * 1000
putStrLn "Terminating..."
terminate app
threadDelay $ 120 * 1000 * 1000