| Safe Haskell | None |
|---|
Network.Wai.Graceful
Description
app req = do
liftIO $ somethingImportant -- like threadDelay 100000000
LBSResponse status200 [("Content-Type", "text/plain")] "Finished!"
main = do
gs <- initGraceful
forkIO $ run 8000 (graceful gs app)
waitForTermination >> gracefulShutdown 15 gs
putStrLn "Bye!"
- initGraceful :: IO Graceful
- data Graceful = Graceful {}
- graceful :: Graceful -> Application -> Application
- gracefulShutdown :: Int -> Graceful -> IO ()
- waitForTermination :: IO ()
Documentation
Constructors
| Graceful | |
Fields | |
graceful :: Graceful -> Application -> ApplicationSource
WAI Middleware that keeps track of active connections and blocks further requests with HTTP503.
Trigger shutdown and monitor progress.
waitForTermination :: IO ()Source
Wait for TERM signal.