Expand description
Awa — Postgres-native background job queue for Rust and Python.
This is the facade crate that re-exports the main types from awa-model, awa-macros, and awa-worker for ergonomic usage.
Re-exports§
pub use awa_model as model;pub use awa_worker as worker;
Modules§
- adapter
- Stable building blocks for external database adapters.
- admin
- bridge
- Transactional enqueue for non-sqlx Postgres stacks.
- callback_
contract - HTTP callback ingress contract — wire types, signing, header names.
- insert
- migrations
- storage
Structs§
- Callback
Config - Configuration for CEL callback expressions.
- Callback
Guard - Proof that this job registered an external callback in the database.
- Client
- The Awa worker client — manages dispatchers, heartbeat, and maintenance.
- Client
Builder - Builder for the Awa worker client.
- DlqMetadata
- DlqRow
- Enqueue
Request - Description of a follow-up job to enqueue when an
on_*_enqueuespec fires. Carries the follow-up’sJobArgsand theInsertOptsapplied to theINSERT. For the common “default opts” case, users can return theJobArgsvalue directly from their closure —EnqueueRequest::from(args)is invoked automatically. - Health
Check - Health check result.
- Insert
Opts - Options for inserting a job.
- Insert
Params - Parameters for bulk insert.
- JobContext
- Context passed to worker handlers during job execution.
- JobKind
Descriptor - JobRow
- A row from the
awa.jobstable. - List
DlqFilter - Partitioned
Queue - A deterministic set of physical queues for one hot logical queue.
- Periodic
Job - A periodic job schedule definition.
- Periodic
JobBuilder - Builder for
PeriodicJob. - Prepared
JobInsert - Pre-computed values for a single job row, ready to bind into any driver.
- Progress
State - Mutable progress buffer shared between handler and heartbeat service.
- Queue
Config - Configuration for a single queue.
- Queue
Descriptor - Code-declared, operator-facing descriptor for a queue.
- Queue
Health - Per-queue health.
- Queue
Storage - Segmented queue storage backend.
- Queue
Storage Config - Rate
Limit - Rate limit configuration for a queue.
- Retention
Policy - Per-queue or global retention policy for completed and failed/cancelled jobs.
- Retry
From DlqOpts - Storage
Status - Unique
Opts - Uniqueness constraint options.
Enums§
- AwaError
- Build
Error - Errors returned when building a worker client.
- Cron
Missed Fire Policy - How AWA handles cron fires missed because evaluation was delayed.
- Default
Action - What
resolve_callbackshould do if no CEL conditions match or no expressions are configured. - JobError
- Error type for job handlers — any error is retryable unless it’s terminal.
- JobEvent
- Typed lifecycle event for a specific job argument type.
- JobResult
- Result of executing a job handler.
- JobState
- Job states in the lifecycle state machine.
- Partitioned
Queue Error - Errors returned when constructing a
PartitionedQueue. - Queue
Capacity - Capacity information for a queue, mode-dependent.
- Rescue
Reason - Why maintenance rescued the job.
- Resolve
Outcome - Outcome of
resolve_callback. - Storage
Capability - Untyped
JobEvent - Untyped lifecycle event keyed only by job kind.
Traits§
Functions§
- insert
- Insert a job with default options.
- insert_
many - Insert multiple jobs in a single statement.
- insert_
many_ copy - Insert many jobs through the compatibility COPY surface.
- insert_
many_ copy_ from_ pool - Convenience wrapper that acquires a connection from the pool.
- insert_
with - Insert a job with custom options.
- map_
sqlx_ error - The single Rust-side mapping from a raw
sqlx::Errorto anAwaError, translating a Postgres unique violation (SQLSTATE 23505) intoAwaError::UniqueConflictwith the offending constraint name. - partition_
for_ ordering_ key - Deterministically map an ordering key to a partition in
[0, partitions). - partition_
hash64 - Portable partition-routing hash over raw ordering-key bytes.
- prepare_
job_ insert - Prepare a single job insert from typed job args and options.
- prepare_
raw_ job_ insert - Prepare a single job insert from raw kind, JSON args, and options.
Type Aliases§
Derive Macros§
- JobArgs
- Derive macro for job argument types.