jobqueue-0.0.15: A job queue library

Safe HaskellNone
LanguageHaskell98

Network.JobQueue.Types

Synopsis

Documentation

data JobActionState e a Source

Constructors

JobActionState 

Fields

jobActions :: [ActionFn e a]
 

Instances

data (Env e, Unit a) => JobM e a b Source

Instances

Monad (JobM e a) 
Functor (JobM e a) 
MonadIO (JobM e a) 
MonadState (JobActionState e a) (JobM e a) 

data ActionM e a b Source

type ActionFn e a = e -> a -> IO (Maybe (JobResult a)) Source

data ActionEnv e a Source

Constructors

ActionEnv 

Fields

getJobEnv :: e
 
getJobUnit :: a
 

Instances

class (Read a, Show a, Desc a, Eq a) => Unit a where Source

Unit class

Minimal complete definition

Nothing

Methods

getPriority :: a -> Int Source

Define the priority of a unit.

getRecovery :: a -> a Source

Define the recovery state of a unit.

data Next a Source

Constructors

Next 

Fields

nextJob :: Maybe a
 
nextForks :: [(a, Maybe UTCTime)]
 

Instances

data Failure Source

Constructors

Failure Alert String 

Instances

data Alert Source

Constructors

Critical 
Error 
Warning 
Notice 
Info 

Instances

runS :: JobM e a b -> StateT (JobActionState e a) IO b Source

runAM :: ActionM e a b -> ErrorT ActionError (ReaderT (ActionEnv e a) (StateT (JobResultState a) IO)) b Source

setResult :: Unit a => Maybe (JobResult a) -> JobResultState a -> JobResultState a Source