1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! # Graphile Worker RS
//!
//! A PostgreSQL-backed job queue implementation for Rust applications. This crate is a Rust port
//! of the Node.js [Graphile Worker](https://github.com/graphile/worker) library.
//!
//! ## Architecture Overview
//!
//! Graphile Worker uses PostgreSQL as its backend for job storage and coordination.
//! The system consists of several key components:
//!
//! - **Worker**: Processes jobs from the queue using the specified concurrency.
//! - **WorkerUtils**: Utility functions for job management (adding, removing, rescheduling, etc.).
//! - **TaskHandler**: Trait that defines how specific job types are processed.
//! - **Job Specification**: Configures job parameters like priority, retry behavior, and scheduling.
//! - **Migrations**: Automatic schema management for the database tables.
//!
//! ## Database Schema
//!
//! Graphile Worker manages its own database schema (default: `graphile_worker`).
//! It automatically handles migrations and uses the following tables:
//!
//! - `_private_jobs`: Stores job data, state, and execution metadata
//! - `_private_tasks`: Tracks registered task types
//! - `_private_job_queues`: Manages job queue names for serialized job execution
//! - `_private_workers`: Tracks active worker instances
//!
//! ## Module Structure
//!
//! The crate is organized into the following modules:
/// Configuration and initialization of worker instances
/// Error types used throughout the crate
/// Job specification and builder for configuring jobs
/// Core worker implementation for running the job queue
/// LocalQueue for batch-fetching jobs to improve throughput
/// Batchers for batching job completions and failures to reduce SQL round trips
pub
/// SQL query implementations for interacting with the database
/// Job stream management for processing jobs
/// General utility functions
/// Utility functions for job management
pub use crate*;
pub use parse_crontab;
pub use *;
pub use *;
pub use *;
pub use *;
pub use ;
pub use WorkerContextExt;
pub use ;
pub use Worker;
pub use RawJobSpec;
pub use WorkerUtils;