arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Job.Types.Internal

Description

Internal to the arbiter packages. Not covered by the PVP.

The job record type and its field accessors.

Synopsis

Documentation

data JobRecord payload key q insertedAt admSource #

Internal representation shared by writable and stored jobs.

Instances

Instances details
FromJSON payload => FromJSON (JobRead payload) Source #

Decode the complete persisted representation of a job.

Instance details

Defined in Arbiter.Core.Job.Types

Methods

parseJSON :: Value -> Parser (JobRead payload)#

parseJSONList :: Value -> Parser [JobRead payload]#

omittedField :: Maybe (JobRead payload)#

ToJSON payload => ToJSON (JobRead payload) Source # 
Instance details

Defined in Arbiter.Core.Job.Types

Methods

toJSON :: JobRead payload -> Value#

toEncoding :: JobRead payload -> Encoding#

toJSONList :: [JobRead payload] -> Value#

toEncodingList :: [JobRead payload] -> Encoding#

omitField :: JobRead payload -> Bool#

(Eq key, Eq payload, Eq q, Eq insertedAt, Eq adm) => Eq (JobRecord payload key q insertedAt adm) Source # 
Instance details

Defined in Arbiter.Core.Job.Types.Internal

Methods

(==) :: JobRecord payload key q insertedAt adm -> JobRecord payload key q insertedAt adm -> Bool#

(/=) :: JobRecord payload key q insertedAt adm -> JobRecord payload key q insertedAt adm -> Bool#

(Show key, Show payload, Show q, Show insertedAt, Show adm) => Show (JobRecord payload key q insertedAt adm) Source # 
Instance details

Defined in Arbiter.Core.Job.Types.Internal

Methods

showsPrec :: Int -> JobRecord payload key q insertedAt adm -> ShowS#

show :: JobRecord payload key q insertedAt adm -> String#

showList :: [JobRecord payload key q insertedAt adm] -> ShowS#

type Job payload key q insertedAt adm = JobRecord payload key q insertedAt admSource #

A job parametrized over payload, primary key, queue name, insertion timestamp, and the columns derived from the payload. The constructor is internal.

newtype Stored payloadSource #

A payload as the JSON bytes the database holds. The type it decodes to is a phantom.

Constructors

Stored ByteString 

Instances

Instances details
FromJSON (Stored payload) Source # 
Instance details

Defined in Arbiter.Core.Job.Types.Internal

Methods

parseJSON :: Value -> Parser (Stored payload)#

parseJSONList :: Value -> Parser [Stored payload]#

omittedField :: Maybe (Stored payload)#

ToJSON (Stored payload) Source #

The bytes are emitted as they are. toJSON has to parse them back.

Instance details

Defined in Arbiter.Core.Job.Types.Internal

Methods

toJSON :: Stored payload -> Value#

toEncoding :: Stored payload -> Encoding#

toJSONList :: [Stored payload] -> Value#

toEncodingList :: [Stored payload] -> Encoding#

omitField :: Stored payload -> Bool#

Eq (Stored payload) Source # 
Instance details

Defined in Arbiter.Core.Job.Types.Internal

Methods

(==) :: Stored payload -> Stored payload -> Bool#

(/=) :: Stored payload -> Stored payload -> Bool#

Show (Stored payload) Source # 
Instance details

Defined in Arbiter.Core.Job.Types.Internal

Methods

showsPrec :: Int -> Stored payload -> ShowS#

show :: Stored payload -> String#

showList :: [Stored payload] -> ShowS#

storedBytes :: Stored payload -> ByteStringSource #

The JSON bytes of a stored payload.

primaryKey :: Job payload key q insertedAt adm -> keySource #

Database-assigned identifier for a stored job.

payload :: Job payload key q insertedAt adm -> payloadSource #

User-defined payload stored as JSONB.

queueName :: Job payload key q insertedAt adm -> qSource #

Queue containing a stored job.

groupKey :: Job payload key q insertedAt adm -> Maybe TextSource #

Serial-processing group, or Nothing for an ungrouped job.

insertedAt :: Job payload key q insertedAt adm -> insertedAtSource #

Time at which the job was inserted.

updatedAt :: Job payload Int64 q insertedAt adm -> Maybe UTCTimeSource #

Time at which the job was last updated.

attempts :: Job payload Int64 q insertedAt adm -> Int32Source #

Number of attempts made so far.

lastError :: Job payload Int64 q insertedAt adm -> Maybe TextSource #

Error message from the last failed attempt.

priority :: Job payload key q insertedAt adm -> Int32Source #

Claim priority. Lower numbers have higher priority. In a group, a retried job goes first.

lastAttemptedAt :: Job payload Int64 q insertedAt adm -> Maybe UTCTimeSource #

Time at which a worker last claimed the job.

notVisibleUntil :: Job payload key q insertedAt adm -> Maybe UTCTimeSource #

Earliest time at which the job can be claimed.

dedupKey :: Job payload key q insertedAt adm -> Maybe DedupKeySource #

Deduplication strategy and key.

maxAttempts :: Job payload key q insertedAt adm -> Maybe Int32Source #

Attempt limit before the job moves to the DLQ.

parentId :: Job payload Int64 q insertedAt adm -> Maybe Int64Source #

Identifier of this job's parent in a job tree.

parentState :: Job payload Int64 q insertedAt adm -> Maybe ValueSource #

Snapshot of accumulated child results for a rollup finalizer.

traceContext :: Job payload key q insertedAt adm -> Maybe TraceContextSource #

W3C trace context captured at enqueue.

suspended :: Job payload Int64 q insertedAt adm -> BoolSource #

Whether the job is suspended. It stays unclaimable until resumed.

claimedBy :: Job payload Int64 q insertedAt adm -> Maybe UUIDSource #

Holder of the outstanding claim. Nothing when no claim is outstanding.

claimSeq :: Job payload Int64 q insertedAt adm -> Int64Source #

The claim token.

archiveFor :: Job payload key q insertedAt adm -> Maybe Int32Source #

Completed-job archive retention in seconds.

payloadKeys :: Job payload key q insertedAt adm -> admSource #

The labels and keys stamped from the payload at enqueue.