IHP Api Reference
Safe HaskellNone

IHP.Job.Types

Synopsis

Documentation

class Job job where Source #

Minimal complete definition

perform

Methods

perform :: job -> IO () Source #

maxAttempts :: Int Source #

timeoutInMicroseconds :: Maybe Int Source #

queuePollInterval :: Int Source #

While jobs are typically fetch using pg_notiy, we have to poll the queue table periodically to catch jobs with a run_at in the future

By default we only poll every minute

maxConcurrency :: Int Source #

How many jobs of this type can be executed at the same time

This limit only applies to the running haskell process. If you run N multiple independent processes of the job runner, the limit will be N * maxConcurrency

backoffStrategy :: BackoffStrategy Source #

data JobStatus Source #

Mapping for JOB_STATUS. The DDL statement for this can be found in IHPSchema.sql:

CREATE TYPE JOB_STATUS AS ENUM ('job_status_not_started', 'job_status_running', 'job_status_failed', 'job_status_succeeded', 'job_status_retry');

Instances

Instances details
Enum JobStatus Source # 
Instance details

Defined in IHP.Job.Types

Read JobStatus Source # 
Instance details

Defined in IHP.Job.Types

Methods

readsPrec :: Int -> ReadS JobStatus

readList :: ReadS [JobStatus]

readPrec :: ReadPrec JobStatus

readListPrec :: ReadPrec [JobStatus]

Show JobStatus Source # 
Instance details

Defined in IHP.Job.Types

Methods

showsPrec :: Int -> JobStatus -> ShowS #

show :: JobStatus -> String

showList :: [JobStatus] -> ShowS #

Default JobStatus Source # 
Instance details

Defined in IHP.Job.Queue

Methods

def :: JobStatus #

Eq JobStatus Source # 
Instance details

Defined in IHP.Job.Types

ParamReader JobStatus Source # 
Instance details

Defined in IHP.Job.Queue

InputValue JobStatus Source # 
Instance details

Defined in IHP.Job.Queue

FromField JobStatus

Mapping for JOB_STATUS:

CREATE TYPE JOB_STATUS AS ENUM ('job_status_not_started', 'job_status_running', 'job_status_failed', 'job_status_succeeded', 'job_status_retry');
Instance details

Defined in IHP.Job.Queue

Methods

fromField :: FieldParser JobStatus

ToField JobStatus

Mapping for JOB_STATUS:

CREATE TYPE JOB_STATUS AS ENUM ('job_status_not_started', 'job_status_running', 'job_status_failed', 'job_status_succeeded', 'job_status_retry');
Instance details

Defined in IHP.Job.Queue

Methods

toField :: JobStatus -> Action

class Worker application where Source #

Methods

workers :: application -> [JobWorker] Source #

data BackoffStrategy Source #

Instances

Instances details
Show BackoffStrategy Source # 
Instance details

Defined in IHP.Job.Types

Eq BackoffStrategy Source # 
Instance details

Defined in IHP.Job.Types