Skip to main content

Module processing

Module processing 

Source
Expand description

Job Processing Engine

This module contains the job processing engine that handles job execution, worker management, and background job processing.

Re-exports§

pub use cleanup::CleanupWorker;
pub use cleanup::DEFAULT_CLEANUP_INTERVAL;
pub use cleanup::DEFAULT_FAILED_TTL;
pub use cleanup::DEFAULT_SUCCEEDED_TTL;
pub use heartbeat::DEFAULT_DEAD_SERVER_TIMEOUT;
pub use heartbeat::DEFAULT_HEARTBEAT_INTERVAL;
pub use heartbeat::HeartbeatWorker;
pub use middleware::JobMiddleware;
pub use middleware::Next;
pub use middleware::TracingMiddleware;
pub use processor::JobProcessor;
pub use processor::StateChangeHook;
pub use recurring::DEFAULT_RECURRING_BATCH_SIZE;
pub use recurring::RecurringJobPoller;
pub use retry::RetryPolicy;
pub use retry::RetryStrategy;
pub use scheduler::JobScheduler;
pub use server::BackgroundJobServer;
pub use server::ServerConfig;
pub use worker::WorkerConfig;
pub use worker::WorkerContext;
pub use worker::WorkerResult;

Modules§

cleanup
Expired-job cleanup worker.
heartbeat
Server heartbeat + dead-server reclaim worker (D1).
middleware
Tower-style middleware around job execution.
processor
Job processor for executing individual jobs
recurring
Recurring-job poller.
retry
Retry logic and policies
scheduler
Job scheduler for delayed and recurring jobs
server
Background job server for managing job processing
worker
Worker types and configuration

Structs§

TypedWorkerAdapter
Adapter that wraps a TypedWorker and implements the untyped Worker trait, deserializing job.payload into W::Args before dispatching.
WorkerRegistry
Registry for job workers

Traits§

TypedWorker
Typed worker trait — receives a deserialized Args value instead of the raw JSON payload.
Worker
Untyped worker trait — receives the raw Job and its JSON payload.