-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Library to write graceful shutdown / upgrade service.
--   
--   Library to write graceful shutdown / upgrade service.
@package graceful
@version 0.1.1.3


-- | Provides function to make process graceful.
module System.Posix.Graceful

-- | Server settings
--   
--   Since 0.1.0.0
data GracefulSettings
GracefulSettings :: IO Socket -> Int -> FilePath -> FilePath -> FilePath -> GracefulSettings

-- | Listen socket
gracefulSettingsListen :: GracefulSettings -> IO Socket

-- | Prefork worker count
gracefulSettingsWorkerCount :: GracefulSettings -> Int

-- | Unix domain socket file
gracefulSettingsSockFile :: GracefulSettings -> FilePath

-- | The file to which the server records the process id
gracefulSettingsPidFile :: GracefulSettings -> FilePath

-- | The binary file to upgrade
gracefulSettingsBinary :: GracefulSettings -> FilePath

-- | Worker process settings
--   
--   Since 0.1.0.0
data GracefulWorker
GracefulWorker :: IO resource -> (Socket -> resource -> IO ()) -> (resource -> IO ()) -> GracefulWorker
gracefulWorkerInitialize :: GracefulWorker -> IO resource
gracefulWorkerApplication :: GracefulWorker -> Socket -> resource -> IO ()
gracefulWorkerFinalize :: GracefulWorker -> resource -> IO ()

-- | Make server application enable shutdown/restart gracefully
--   
--   Since 0.1.0.0
graceful :: GracefulSettings -> GracefulWorker -> IO ()
