arbiter-core-0.1.0.0: Core types and logic for PostgreSQL-backed job queue
Safe HaskellNone
LanguageGHC2024

Arbiter.Core

Description

Re-exports commonly used Arbiter functionality.

Synopsis

Core types

High-level operations

Job tree DSL

data JobTree payload Source #

A tree of jobs. Leaves are single jobs; finalizers are parents with children that run immediately while the parent waits for completion.

leaf :: JobWrite payload -> JobTree payload Source #

A single job (leaf node) — a terminal node with no children.

rollup :: JobWrite payload -> NonEmpty (JobTree payload) -> JobTree payload Source #

Finalizer that runs after all children finish.

For nested rollups, intermediate finalizers must explicitly return the merged value to propagate results upward. This is not automatic. When no children remain in the main queue (all completed or DLQ'd), the finalizer wakes.

rollup (defaultJob root)
  ( leaf (defaultJob leaf1)
  :| [leaf (defaultJob leaf2)]
  )

(<~~) :: JobWrite payload -> NonEmpty (JobWrite payload) -> JobTree payload infixr 6 Source #

Infix rollup for leaf-only children.

defaultJob reducer <~~ (defaultJob mapper1 :| [defaultJob mapper2])

Typed codecs and parameters

Schema

Exceptions

Connection pool settings