prefork-0.0.7: A library for building a prefork-style server quickly

Safe HaskellSafe-Inferred
LanguageHaskell98

System.Prefork.Types

Synopsis

Documentation

data PreforkSettings sc Source

This represents handlers for controlling child processes.

The type parameter sc is a server configuration (application specific).

Constructors

PreforkSettings 

Fields

psOnTerminate :: sc -> [ProcessID] -> IO ()

This is called on TERM signal.

psOnInterrupt :: sc -> [ProcessID] -> IO ()

This is called on INT signal.

psOnQuit :: sc -> IO ()

This is called on QUIT signal.

psOnChildFinished :: sc -> IO [ProcessID]

This is called on CHILD signal.

psOnStart :: Maybe sc -> IO ()

This is called on the start of a parent.

psOnFinish :: Maybe sc -> IO ()

This is called on the finish of a parent.

psUpdateServer :: sc -> IO [ProcessID]

This is called when the server state has changed.

psCleanupChild :: sc -> ProcessID -> IO ()

This is called when one of child process has finished.

psUpdateConfig :: IO (Maybe sc)

This is called when a configuration is needed.

data PreforkResource w Source

Constructors

PreforkResource 

Fields

prProcs :: TVar (Map ProcessID w)
 
prWorkers :: TVar (Set w)
 

updateWorkerSet :: (Ord w, Eq w) => PreforkResource w -> [w] -> IO () Source