jobqueue-0.1.6: A job queue library

Safe HaskellNone
LanguageHaskell98

Network.JobQueue.Action

Synopsis

Documentation

runAction :: (Aux e, Env e, Unit a) => e -> a -> ActionT e a IO () -> IO (Either Break (Maybe (RuntimeState a))) Source

getEnv :: (Env e, Unit a) => ActionM e a e Source

Get environment in action.

next Source

Arguments

:: (Env e, Unit a) 
=> a

the next state

-> ActionM e a () 

Move to the next state immediately. After the execution of the action the job being processed will be moved to the given state. The next action will be invoked immediately and can continue to work without being interrupted by another job. NOTE: This overrides the next state if it is already set.

orNext Source

Arguments

:: (Env e, Unit a) 
=> a

the next state

-> ActionM e a () 

Move to the next state immediately. This is different from "next" function because this doesn't override if the next job is already set.

fin :: (Env e, Unit a) => ActionM e a () Source

Finish a job.

none :: (Env e, Unit a) => ActionM e a () Source

If the unit passed by the job queue system cannot be processed by the action function, the function should call this.

fork Source

Arguments

:: (Env e, Unit a) 
=> a

a unit

-> ActionM e a () 

Create a job with a unit and schedule it.

forkInTime :: (Env e, Unit a) => NominalDiffTime -> a -> ActionM e a () Source

Create a job with a unit and schedule it after a few micro seconds.

forkOnTime Source

Arguments

:: (Env e, Unit a) 
=> UTCTime

absolute time in UTC

-> a

a unit

-> ActionM e a () 

Create a job with a unit and schedule it at a specific time.

abort :: (Env e, Unit a) => ActionM e a b Source

Abort the execution of a state machine. If a critical problem is found and there is a need to switch to the failure state, call this function.

commitIO :: (Env e, Unit a) => IO b -> ActionM e a b Source

Do a dirty I/O action with a side effect to the external system. If it doesn't change the state of the external system, you should use liftIO instead.

liftIO :: MonadIO m => forall a. IO a -> m a

Lift a computation from the IO monad.

yield :: (Env e, Unit a) => ActionM e a () Source

Yield execution