| Crates.io | rustapi-jobs |
| lib.rs | rustapi-jobs |
| version | 0.1.207 |
| created_at | 2026-01-14 03:45:05.326453+00 |
| updated_at | 2026-01-26 00:04:07.253262+00 |
| description | Robust background job processing for RustAPI. Support for Redis and PostgreSQL backends, retries, and scheduled tasks. |
| homepage | https://github.com/Tuntii/RustAPI |
| repository | https://github.com/Tuntii/RustAPI |
| max_upload_size | |
| id | 2042103 |
| size | 101,870 |
Background job processing for RustAPI.
Offload heavy tasks (emails, report generation, webhooks) to background workers.
use rustapi_jobs::{Job, JobContext};
#[derive(Serialize, Deserialize)]
struct SendEmail {
to: String,
content: String,
}
#[async_trait]
impl Job for SendEmail {
const NAME: &'static str = "send_email";
async fn run(&self, _ctx: JobContext) -> Result<()> {
// Send the email...
Ok(())
}
}
// Enqueue
queue.push(SendEmail { ... }).await?;