gargoyle- Automatically spin up and spin down local daemons
Safe HaskellNone



Utilities for running a daemon in a local directory



data Gargoyle pid a Source #




withGargoyle Source #


:: 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 Gargoyle.

-> 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.

gargoyleMain Source #


:: 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.