Skip to main content

Module queue

Module queue 

Source

Structs§

JobRegistry
Maps a Job::JOB_TYPE tag back to the concrete type that can deserialize and run it - built fresh by whatever calls work() (typically the generated app’s own queue:work branch in main.rs), not a process-wide static: only one work() loop reads it, in the one process running it, so there’s no cross-request sharing need the way larust-events’ listener registry or larust_http::route’s named-route registry have.

Traits§

Job
A unit of deferred work. Implemented once per job type, the same “app implements this once per thing” shape as Policy<U>/Mailable.

Functions§

dispatch
Serializes job to JSON and enqueues it - durable the moment this returns Ok, independent of whether any xr queue:work process is currently running to pick it up.
prune_failed_jobs
Deletes/trims old entries from whichever failed_jobs store [crate::queue_driver] selects - see the two backend-specific implementations’ own doc comments for the exact retention policy each uses (time-based for SQL, count-based for Redis).
work
Runs forever, claiming and executing jobs one at a time until the process is stopped (Ctrl+C / killed - no signal handling here, same as Laravel’s own queue:work without --stop-when-empty). A job whose handler fails, or whose job_type has no registered handler, is recorded as a failure rather than retried forever or silently dropped.