background-jobs

Schedule and process Postgres-backed background tasks with apalis in Rust+Leptos+Axum.

Updated May 26, 2026
One-click install
npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill background-jobs-adelabdelgawad
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: background-jobs
Source: https://github.com/adelabdelgawad/rust-fullstack-agents/tree/main/plugins/rusty/skills/background-jobs
Command: npx skills add https://github.com/adelabdelgawad/rust-fullstack-agents --skill background-jobs-adelabdelgawad

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rust+Leptos+Axum apps frequently block on long-running work inside request paths. This Skill provides a durable pattern to schedule, queue, and process background tasks using apalis with a Postgres backend, including retries and a dead-letter workflow.

Core Features & Use Cases

  • Queued background tasks for emails, reports, webhooks, and maintenance
  • Cron-based jobs and scheduled work alongside server functions
  • Durable workers with retry logic and a dead-letter queue for failures

Quick Start

Enqueue a background task from a server function and let a durable worker process it on a Postgres-backed storage.

Frequently Asked Questions about background-jobs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run background tasks in Rust without blocking HTTP requests in Leptos and Axum?

Background jobs in Rust can run outside the HTTP request cycle by enqueuing work from server functions to durable workers. This pattern uses apalis with a Postgres backend to queue and process long-running jobs like emails, reports, and webhooks reliably.

How do I schedule cron jobs and recurring tasks using apalis with a Postgres backend?

Scheduling cron jobs with apalis involves using apalis-cron alongside Postgres storage to manage recurring work. This setup supports durable workers that execute scheduled tasks and standard background jobs within the same Rust application.

Does this background worker pattern handle task failures and retries?

The background worker pattern handles task failures using built-in retry logic and a dead-letter queue. When a queued job fails repeatedly, it routes to the dead-letter workflow, preventing data loss during long-running work processing.

Can I enqueue background jobs directly from server functions in a Leptos application?

You can enqueue background jobs directly from server functions in a Leptos application. The implementation enforces enqueue-from-server-fn semantics at startup, ensuring that tasks are safely queued to the Postgres storage backend.

Do I need a separate Postgres database to store and process background jobs with apalis?

You need a Postgres database to provide durable storage for background jobs using apalis. The Postgres backend acts as the storage layer for queuing, retrying, and managing the dead-letter queue for long-running work.