API Reference ergon v#0.5.0
View SourceModules
PostgreSQL-native background job and workflow processing.
Ergon's application callback.
Scheduling SQL with pg_cron, guarded so the same code runs where it is absent.
Low-level database access for Ergon.
The job lifecycle state machine, as a pure function.
Workflow dependency resolution over PostgreSQL 19's SQL/PGQ property graph.
Liveness and diagnostics, in one call.
The guard on names that reach SQL as identifiers rather than as bind parameters.
A fully materialised job row, plus the helpers that translate between the state
text column and the atoms the state machine speaks.
Turns ergon.jobs into a reactive queue: one LISTEN connection that wakes the
right workers the instant a runnable job lands, instead of making them wait out
their poll interval.
Executes one job: runs the host's handler, then persists the outcome.
The node's single LISTEN connection, shared by everything that wants
notifications.
Ergon's schema migrations, driven by migraterl.
DDL generators for host tables that want Ergon's patterns.
The specification for a job that has not been inserted yet.
Boot-time fail-safe for a monthly-partitioned table.
Resolving the directory specs Ergon accepts from host applications.
Thin wrappers over pgmq, plus the queue and notification management a host needs.
Streams messages off a pgmq queue, one batch at a time.
The dynamic supervisor pgmq consumers run under.
Runtime configuration for one pgmq consumer. Mirrors ergon_queue, so both
kinds of queue are configured the same way.
Executes one pgmq message and reports the result back to its consumer.
Everything one call to ergon:start_consumer/2 creates.
Runtime configuration for a single named queue: how often a worker polls it and
how many jobs it takes per poll. Build with new/1 plus the setters so call
sites are unaffected when a new tuning knob is added.
Everything one call to ergon:start_worker/2 creates: an executor pool and the
poller that feeds it.
Disaster recovery: put the runtime back in step with what the database says.
Ergon's connection layer: a thin wrapper over pgo.
Filesystem-backed SQL loader and executor.
Ergon's root supervisor.
The decoded form of a PostgreSQL temporal validity period.
The polling loop for one queue.
Routes NOTIFY wake-ups from ergon_job_notifier to the workers that care.
The dynamic supervisor queue workers run under.