touched-0.2.0.1: Library (and cli) to execute a procedure on file change.

Safe HaskellSafe-Inferred
LanguageHaskell2010

System.Touched.OnlyOne

Synopsis

Documentation

data OnlyOne a b Source

A wrapper over a process which allows only one instance of the process to be active at any one time.

Constructors

Inactive (Procedure a b) 
Active (Procedure a b) b UTCTime 

otTime :: OnlyOne a b -> Maybe UTCTime Source

Gets the time a process launched

old :: OnlyOne a b -> UTCTime -> Bool Source

Compare a process' launch time with a UTCTime, returning a Bool specifying whether or not the process was launched prior to the time.

otKill :: OnlyOne a b -> IO (OnlyOne a b) Source

Forces any OnlyOne process into Inactive Mode.

otStart :: OnlyOne a b -> IO (OnlyOne a b) Source

Starts a process if it has not been started, restarts a process that has been started

restartOld :: OnlyOne a b -> UTCTime -> IO (OnlyOne a b) Source

Takes an OnlyOne lifted process and a UTCTime. If the process was launched prior to the UTCTime, the process is (re)started. Otherwise, it's just returned.