| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Faktory.Job
Synopsis
- data Job arg
- type JobId = String
- data JobOptions
- perform :: (HasCallStack, ToJSON arg) => JobOptions -> Producer -> arg -> IO JobId
- retry :: Int -> JobOptions
- once :: JobOptions
- queue :: Queue -> JobOptions
- jobtype :: String -> JobOptions
- at :: UTCTime -> JobOptions
- in_ :: NominalDiffTime -> JobOptions
- custom :: ToJSON a => a -> JobOptions
- buildJob :: JobOptions -> Producer -> arg -> IO (Job arg)
- newJob :: arg -> IO (Job arg)
- jobJid :: Job arg -> JobId
- jobArg :: Job arg -> arg
Documentation
data JobOptions Source #
Options for the execution of a job
These can be constructed using (<>):
let options =retry1 <>jobtypeMyJob
To enqueue with defaults, use mempty.
Options use Last semantics, so (e.g.) will set retries to
retry x <>x only if not already set, and <> will override any
already-present retries to retry xx.
Instances
perform :: (HasCallStack, ToJSON arg) => JobOptions -> Producer -> arg -> IO JobId Source #
retry :: Int -> JobOptions Source #
once :: JobOptions Source #
Equivalent to : no retries, and move to Dead on failureretry (-1)
queue :: Queue -> JobOptions Source #
jobtype :: String -> JobOptions Source #
at :: UTCTime -> JobOptions Source #
in_ :: NominalDiffTime -> JobOptions Source #
custom :: ToJSON a => a -> JobOptions Source #