Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for running a daemon in a local directory
Synopsis
- data Gargoyle pid a = Gargoyle {
- _gargoyle_exec :: FilePath
- _gargoyle_init :: FilePath -> IO ()
- _gargoyle_start :: FilePath -> IO pid
- _gargoyle_stop :: pid -> IO ()
- _gargoyle_getInfo :: FilePath -> IO a
- withGargoyle :: Gargoyle pid a -> FilePath -> (a -> IO b) -> IO b
- gargoyleMain :: Gargoyle pid a -> IO ()
Documentation
Gargoyle | |
|
:: Gargoyle pid a | Description of how to manage the daemon. |
-> FilePath | The directory where the daemon should be initialized. |
-> (a -> IO b) | Client action which has access to runtime information provided by
the |
-> IO b | By the time this function returns, the monitor process is aware that the the client is no longer interested in the daemon. |
Run an IO action while maintaining a connection to a daemon. The daemon will automatically be
stopped when no clients remain. If the daemon has not yet been initialized, it will be.
The counterpart of this function is gargoyleMain
which should be used to produce an executable
that will monitor the daemon's status.
:: Gargoyle pid a | Description of how to initialize, spin up, and spin down a daemon. |
-> IO () | Returns only when all clients have disconnected. |
Run a local daemon over a domain socket; the daemon will be automatically stopped when
no clients remain. This function assumes that the daemon has already been initialized
in the specified location. This function should be used as the main function of an executable
which will then be invoked by calling withGargoyle
in the client code to monitor
the daemon's status.