arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Sql.Claim

Description

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

Claim-time SQL: candidate selection, admission gates, and the batched claim.

Synopsis

Documentation

data ClaimAdmissionSource #

Which admission filters the claim SQL renders. A payload type that declares no policy of a kind gets no filter for it.

Constructors

ClaimAdmission 

Fields

claimJobsBatchedSQL :: SchemaName -> TableName -> ClaimAdmission -> Int -> Int -> NominalDiffTime -> UUID -> Query ()Source #

The single-CTE batched claim, which at batch size 1 is the single-job claim. Takes any unsuspended, uncancelled, visible job within its attempt budget, rollup children and woken rollup parents included. Each gate's CTEs render from the ClaimAdmission flags. The caller attaches the row decoder.

concHeadroomPred :: Text -> Text -> Text -> TextSource #

Concurrency headroom over a candidate row alias. Keeps a full key off the bounded candidate window, in the ungrouped pool and at each group's head. OFFSET 0 keeps the probe correlated.

groupHeadBatch :: Text -> Text -> [Text] -> Text -> TextSource #

A group's claimable rows in claim order: the two index-served head runs, merged with retried rows first. Projects extras, priority and id over alias job.