faktory-1.1.1.0: Faktory Worker for Haskell
Safe HaskellNone
LanguageHaskell2010

Faktory.Job

Synopsis

Documentation

data Job arg Source #

Instances

Instances details
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 #

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

Defined in Faktory.Job

Methods

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

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

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
Generic JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

Associated Types

type Rep JobOptions :: Type -> Type #

Semigroup JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

Monoid JobOptions Source # 
Instance details

Defined in Faktory.JobOptions

FromJSON 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 #