faktory-1.1.2.7: Faktory Worker for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Faktory.Job

Synopsis

Documentation

data Job arg Source #

Instances

Instances details
Foldable Job Source # 
Instance details

Defined in Faktory.Job

Methods

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 #

toList :: Job a -> [a] #

null :: Job a -> Bool #

length :: Job a -> Int #

elem :: Eq a => a -> Job a -> Bool #

maximum :: Ord a => Job a -> a #

minimum :: Ord a => Job a -> a #

sum :: Num a => Job a -> a #

product :: Num a => Job a -> a #

Traversable Job Source # 
Instance details

Defined in Faktory.Job

Methods

traverse :: Applicative f => (a -> f b) -> Job a -> f (Job b) #

sequenceA :: Applicative f => Job (f a) -> f (Job a) #

mapM :: Monad m => (a -> m b) -> Job a -> m (Job b) #

sequence :: Monad m => Job (m a) -> m (Job a) #

Functor Job Source # 
Instance details

Defined in Faktory.Job

Methods

fmap :: (a -> b) -> Job a -> Job b #

(<$) :: a -> Job b -> Job a #

FromJSON args => FromJSON (Job args) Source # 
Instance details

Defined in Faktory.Job

Methods

parseJSON :: Value -> Parser (Job args) #

parseJSONList :: Value -> Parser [Job args] #

omittedField :: Maybe (Job args) #

ToJSON args => ToJSON (Job args) Source # 
Instance details

Defined in Faktory.Job

Methods

toJSON :: Job args -> Value #

toEncoding :: Job args -> Encoding #

toJSONList :: [Job args] -> Value #

toEncodingList :: [Job args] -> Encoding #

omitField :: Job args -> Bool #

Show arg => Show (Job arg) Source # 
Instance details

Defined in Faktory.Job

Methods

showsPrec :: Int -> Job arg -> ShowS #

show :: Job arg -> String #

showList :: [Job arg] -> ShowS #

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.) retry x <> will set retries to x only if not already set, and <> retry x will override any already-present retries to x.

Instances

Instances details
FromJSON JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

Monoid JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

Semigroup JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

Generic JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

Associated Types

type Rep JobOptions :: Type -> Type #

Show JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

Eq JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

type Rep JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

perform :: (HasCallStack, ToJSON arg) => JobOptions -> Producer -> arg -> IO JobId Source #

Perform a Job with the given options

perform mempty SomeJob
perform (queue SomeQueue) SomeJob
perform once SomeJob
perform (at someTime <> once) SomeJob
perform (in_ 10 <> once) SomeJob
perform (in_ 10 <> retry 3) SomeJob

once :: JobOptions Source #

Equivalent to retry (-1): no retries, and move to Dead on failure

buildJob :: JobOptions -> Producer -> arg -> IO (Job arg) Source #

Construct a Job and apply options and Producer settings

newJob :: arg -> IO (Job arg) Source #

Construct a Job with default JobOptions

jobJid :: Job arg -> JobId Source #

jobArg :: Job arg -> arg Source #