IHP Api Reference
Safe HaskellNone

IHP.Job.Types

Synopsis

Documentation

class Job job where Source #

Minimal complete definition

perform

Methods

perform :: (?modelContext :: ModelContext, ?context :: FrameworkConfig) => job -> IO () Source #

maxAttempts :: (?job :: job) => Int Source #

timeoutInMicroseconds :: (?job :: job) => 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

newtype JobWorker Source #

Constructors

JobWorker (JobWorkerArgs -> IO (Async ())) 

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

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

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

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

InputValue JobStatus Source # 
Instance details

Defined in IHP.Job.Queue

ParamReader JobStatus Source # 
Instance details

Defined in IHP.Job.Queue

class Worker application where Source #

Methods

workers :: application -> [JobWorker] Source #