graceful-0.1.1.3: Library to write graceful shutdown / upgrade service.

Portability | unknown
Stability | experimental
Maintainer | n.ohkawa@gmail.com
Safe Haskell | None

System.Posix.Graceful

Description

Provides function to make process graceful.

Synopsis

- data GracefulSettings = GracefulSettings {
  - gracefulSettingsListen :: IO Socket
  - gracefulSettingsWorkerCount :: Int
  - gracefulSettingsSockFile :: FilePath
  - gracefulSettingsPidFile :: FilePath
  - gracefulSettingsBinary :: FilePath
  }
- data GracefulWorker = forall resource . GracefulWorker {
  - gracefulWorkerInitialize :: IO resource
  - gracefulWorkerApplication :: Socket -> resource -> IO ()
  - gracefulWorkerFinalize :: resource -> IO ()
  }
- graceful :: GracefulSettings -> GracefulWorker -> IO ()

# Documentation

data GracefulSettings Source

Server settings

Since 0.1.0.0

Constructors

GracefulSettings |

Fields

gracefulSettingsListen :: IO Socket

  Listen socket

gracefulSettingsWorkerCount :: Int

  Prefork worker count

gracefulSettingsSockFile :: FilePath

  Unix domain socket file

gracefulSettingsPidFile :: FilePath

  The file to which the server records the process id

gracefulSettingsBinary :: FilePath

  The binary file to upgrade

data GracefulWorker Source

Worker process settings

Since 0.1.0.0

Constructors

forall resource . GracefulWorker |

Fields

gracefulWorkerInitialize :: IO resource
gracefulWorkerApplication :: Socket -> resource -> IO ()
gracefulWorkerFinalize :: resource -> IO ()

graceful :: GracefulSettings -> GracefulWorker -> IO ()Source

Make server application enable shutdown/restart gracefully

Since 0.1.0.0