Safe Haskell | None |
---|---|
Language | Haskell2010 |
Executor for external tasks.
An executor will poll for tasks on the co-ordinator, mark them as in progress and then execute them.
You probably want to start with executeLoop
.
Synopsis
- data ExecutionResult
- execute :: ContentStore -> TaskDescription -> KatipContextT IO ExecutionResult
- executeLoop :: forall c. Coordinator c => c -> Config c -> ContentStore -> IO ()
- executeLoopWithScribe :: forall c. Coordinator c => c -> Config c -> ContentStore -> Scribe -> IO ()
- withFollowFile :: Path Abs File -> Handle -> IO a -> IO a
Documentation
data ExecutionResult Source #
Cached | The result already exists in the store and there is no need to execute. This is also returned if the job is already running elsewhere. |
AlreadyRunning | The computation is already running elsewhere. This is probably indicative of a bug, because the coordinator should only allow one instance of a task to be running at any time. |
Success TimeSpec | Execution completed successfully after a certain amount of time. |
Failure TimeSpec Int | Execution failed with the following exit code. TODO where should logs go? |
ExecutorFailure IOException | The executor itself failed to execute the external task. E.g. because the executable was not found. |
execute :: ContentStore -> TaskDescription -> KatipContextT IO ExecutionResult Source #
Execute an individual task.
executeLoop :: forall c. Coordinator c => c -> Config c -> ContentStore -> IO () Source #
Execute tasks forever
executeLoopWithScribe :: forall c. Coordinator c => c -> Config c -> ContentStore -> Scribe -> IO () Source #
Same as executeLoop
, but allows specifying a custom Scribe
for logging