jobs-ui: A library for creating a jobs management website running custom jobs.

[ apache, library, web ] [ Propose Tags ]

A library for creating a jobs management website running custom jobs by defining jobs in Haskell.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0
Dependencies base (>=4.7 && <5), bytestring, containers, deepseq, digestive-functors, digestive-functors-lucid, file-embed, http-types, hvect, lucid, mtl, pretty-relative-time, Spock, Spock-digestive, Spock-lucid, stm, text, time, transformers [details]
License Apache-2.0
Copyright 2019 Gil Mizrahi
Author Gil Mizrahi
Maintainer gilmi@posteo.net
Category Web
Source repo head: git clone https://gitlab.com/gilmi/jobs-ui
Uploaded by gilmi at 2019-12-21T09:15:34Z
Distributions
Downloads 985 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for jobs-ui-0.1.0.0

[back to package description]

Jobs UI is a UI system for queuing and running custom IO Jobs.

License: Apache License 2.0

Example image

Deps

This package uses hpack and stack.

Usage

See the example project.

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