@hackage jobs-ui0.2.0.0
A library for creating a jobs management website running custom jobs.
Categories
License
Apache-2.0
Maintainer
gilmi@posteo.net
Links
Versions
Installation
Dependencies (20)
- Spock
- Spock-digestive
- Spock-lucid
- base >=4.7 && <5
- bytestring
- containers Show all…
Dependents (0)
Jobs UI is a UI system for queuing and running custom IO Jobs.
License: Apache License 2.0

Usage
Define your own custom jobs using the JobInfo type:
data JobInfo a
= JobInfo
{ jiType :: T.Text -- ^ The name of the job type.
, jiInputs :: [Param] -- ^ Definition of user parameters.
, jiParams :: a -> [T.Text]
-- ^ Conversion from the job payload structure to presentable parameters.
, jiConstructor :: [(T.Text, T.Text)] -> IO a
-- ^ Construct a payload type from user entered parameters.
, jiExec :: a -> IO T.Text
-- ^ How to execute a job. Returns a presentable Html when the job succeeds.
, jiNotify :: a -> (Result T.Text T.Text) -> IO ()
-- ^ Will be run when job ends.
}
Wrap it in the JobType constructor, and pass it to the run :: [JobType] -> IO ().