arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Sql.DLQ

Description

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

DLQ SQL templates.

Synopsis

Documentation

data DLQMoveSource #

Whether a DLQ move re-checks the attempt budget it was selected on.

Constructors

MoveNow

Move the job without a re-check.

MoveIfExhausted

Move the job only while it is still unsuspended, uncancelled, visible and out of attempts.

Instances

Instances details
Eq DLQMove Source # 
Instance details

Defined in Arbiter.Core.Sql.DLQ

Methods

(==) :: DLQMove -> DLQMove -> Bool#

(/=) :: DLQMove -> DLQMove -> Bool#

Show DLQMove Source # 
Instance details

Defined in Arbiter.Core.Sql.DLQ

moveToDLQSQL :: DLQMove -> SchemaName -> TableName -> Int64 -> Int64 -> Text -> Query Int64Source #

Move a job to the DLQ in one statement. Copy the carried job columns (dlqCarriedCols) and the failure message.

selectExhaustedJobsSQL :: SchemaName -> TableName -> Int -> Query (Int64, Int64, Maybe Int64, Bool)Source #

Up to limit visible, unsuspended, uncancelled jobs with no attempts left.

retryFromDLQSQL :: SchemaName -> TableName -> Int64 -> Maybe RowEdit -> Query (JobRead (Stored payload))Source #

Retry a DLQ job and its complete DLQ tree in one statement. Any member identifies the tree. Restore the root, all descendants in the DLQ, and their finalizers. Keep a finalizer suspended when it has children in the retry or the main queue. Make it ready when it has no children. Re-suspend a main-queue rollup parent that gains restored children, unless it is under a live lease. Refuse a root whose parent is absent from the main queue. Remove the deduplication key during the retry. An edit replaces its columns on the target row only. Returns the target's restored row.

dlqRetryParentSQL :: SchemaName -> TableName -> Int64 -> Query Int64Source #

The main-queue parent of the tree a DLQ retry restores.

lockDLQRetryParentSQL :: SchemaName -> TableName -> Int64 -> Query Int64Source #

Lock the main-queue parent of the tree a DLQ retry restores.

lockDLQRetryGroupsSQL :: SchemaName -> TableName -> Int64 -> Query ()Source #

Create and lock, in key order, the group summaries of the tree a DLQ retry restores and of its parent.

dlqJobExistsSQL :: SchemaName -> TableName -> Int64 -> Query BoolSource #

Whether a DLQ job with the given id exists.

moveToDLQBatchSQL :: SchemaName -> TableName -> [Int64] -> [Int64] -> [Text] -> Query Int64Source #

moveToDLQSQL over unnested (id, claim_seq, error_msg) arrays. Locks rows in descending id order. Returns the ids moved.

deleteDLQJobsBatchSQL :: SchemaName -> TableName -> [Int64] -> Query (Int64, Maybe Int64)Source #

Delete DLQ jobs by id, returning each one's id and parent id.

selectExpiredDLQSQL :: SchemaName -> TableName -> Int64 -> Int -> Query Int64Source #

Up to limit DLQ ids, oldest first, of rows that failed more than retention seconds ago.

dlqParentIdsSQL :: SchemaName -> TableName -> [Int64] -> Query (Maybe Int64)Source #

The parents of the given DLQ rows.

cascadeChildrenToDLQSQL :: SchemaName -> TableName -> Int64 -> Text -> Query Int64Source #

Move every descendant of a rollup parent to the DLQ alongside it.

countDLQChildrenBatchSQL :: SchemaName -> TableName -> [Int64] -> Query (Int64, Int64)Source #

DLQ child count per parent, over a set of job ids.

listDLQFilteredSQL :: SchemaName -> TableName -> Query () -> Text -> Int64 -> Int64 -> Query (Int64, UTCTime, JobRead (Stored payload))Source #

List DLQ jobs under a dynamic WHERE and an orderBy from buildDLQOrderBy.

countDLQFilteredSQL :: SchemaName -> TableName -> Query () -> Query Int64Source #

Count DLQ jobs under a dynamic WHERE.

dlqIdsFilteredSQL :: SchemaName -> TableName -> Query () -> Query Int64Source #

The ids of the DLQ jobs under a dynamic WHERE, oldest first.