on master help sign in
Merge pull request #596 from 4e6/install-shutdown-handler-example
3736ea9Michael Snoyman
warp/Network/Wai/Handler/Warp.hs+10
@@ -286,6 +286,16 @@ getGracefulShutdownTimeout = settingsGracefulShutdownTimeout
286-- handler. The handler should call the first argument,
286-- handler. The handler should call the first argument,
287-- which closes the listen socket, at shutdown.
287-- which closes the listen socket, at shutdown.
288--
288--
289+-- Example usage:
290+--
291+-- @
292+-- settings :: IO () -> 'Settings'
293+-- settings shutdownAction = 'setInstallShutdownHandler' shutdownHandler 'defaultSettings'
294+-- __where__
295+-- shutdownHandler closeSocket =
296+-- void $ 'System.Posix.Signals.installHandler' 'System.Posix.Signals.sigTERM' ('System.Posix.Signals.Catch' $ shutdownAction >> closeSocket) 'Nothing'
297+-- @
298+--
289-- Default: does not install any code.
299-- Default: does not install any code.
290--
300--
291-- Since 3.0.1
301-- Since 3.0.1