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
Instances
Foldable Job Source # | |
Defined in Faktory.Job fold :: Monoid m => Job m -> m # foldMap :: Monoid m => (a -> m) -> Job a -> m # foldMap' :: Monoid m => (a -> m) -> Job a -> m # foldr :: (a -> b -> b) -> b -> Job a -> b # foldr' :: (a -> b -> b) -> b -> Job a -> b # foldl :: (b -> a -> b) -> b -> Job a -> b # foldl' :: (b -> a -> b) -> b -> Job a -> b # foldr1 :: (a -> a -> a) -> Job a -> a # foldl1 :: (a -> a -> a) -> Job a -> a # elem :: Eq a => a -> Job a -> Bool # maximum :: Ord a => Job a -> a # | |
Traversable Job Source # | |
Functor Job Source # | |
FromJSON args => FromJSON (Job args) Source # | |
Defined in Faktory.Job | |
ToJSON args => ToJSON (Job args) Source # | |
Show arg => Show (Job arg) Source # | |
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 #