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

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0, 0.1.0.1, 0.2.0.0
Change log None available
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:13:45Z

Modules

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


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