Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Job arg
- type JobId = String
- data JobOptions
- perform :: (HasCallStack, ToJSON arg) => JobOptions -> Producer -> arg -> IO JobId
- retry :: Int -> JobOptions
- once :: JobOptions
- reserveFor :: Natural -> 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
- jobOptions :: Job arg -> JobOptions
- jobRetriesRemaining :: Job arg -> Int
- jobReserveForMicroseconds :: Job arg -> Int
Documentation
data JobOptions Source #
Options for the execution of a job
These can be constructed using (<>)
:
let options =retry
1 <>jobtype
MyJob
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)
reserveFor :: Natural -> JobOptions Source #
queue :: Queue -> JobOptions Source #
jobtype :: String -> JobOptions Source #
at :: UTCTime -> JobOptions Source #
in_ :: NominalDiffTime -> JobOptions Source #
custom :: ToJSON a => a -> JobOptions Source #
buildJob :: JobOptions -> Producer -> arg -> IO (Job arg) Source #
Construct a Job
and apply options and Producer settings
jobOptions :: Job arg -> JobOptions Source #
jobRetriesRemaining :: Job arg -> Int Source #
jobReserveForMicroseconds :: Job arg -> Int Source #