queue_job
This module provides an asynchronous job queuing system for Odoo, allowing method calls to be postponed and executed in the background.
Key Features
- queue.job: Provides views for managing jobs stored in PostgreSQL
- jobrunner: Executes jobs in the background using a highly efficient runner leveraging PostgreSQL's NOTIFY
- queue.job.channel: Supports channels with capacity limits for root and sub-channels to segregate and control job execution concurrency
- queue.job: Enables job retries with configurable retry patterns based on attempt counts
- queue.job: Allows setting job properties such as priority, ETA, description, and maximum retries
- queue.job: Includes related actions on job views to link to associated records
- delayable: Offers with_delay() method to postpone method execution asynchronously
- delayable: Supports job dependencies using on_done() for sequential execution
- delayable: Provides chain() and group() primitives for building complex job graphs with parallel and sequential execution
- delayable: Allows splitting large jobs into smaller parallel or chained sub-jobs
- queue.job.function: Enables configuration of default job options via XML records for specific model methods
- queue.job: Supports job context transfer with an allow-list for relevant context keys
- testing: Provides trap_jobs() for asserting enqueued jobs in tests
- testing: Allows bypassing job queuing in tests with queue_job__no_delay context
- queue.job: Handles job states including pending, enqueued, started, done, failed, and cancelled
- queue.job: Automatically requeues stale jobs left in started or enqueued state after server interruptions