ishikari

Crates.ioishikari
lib.rsishikari
version0.1.1
created_at2025-06-14 19:28:26.55699+00
updated_at2025-06-14 21:48:58.483048+00
descriptionAtomic, transaction-safe job queueing for Rust applications. Backed by PostgreSQL. Features include reliable background job execution, queue management, retry mechanisms, and flexible backoff strategies.
homepage
repositoryhttps://github.com/scrogson/ishikari
max_upload_size
id1712617
size133,939
Sonny Scroggin (scrogson)

documentation

README

Ishikari

Ishikari is a robust job processing system written in Rust, designed for reliable background job execution with features like retries, backoff strategies, and queue management.

Features

  • Job Processing: Reliable background job execution with PostgreSQL-backed storage
  • Queue Management: Support for multiple queues with configurable priorities
  • Retry Mechanism: Flexible retry strategies with various backoff options:
    • Fixed delay
    • Linear backoff
    • Exponential backoff
    • Exponential backoff with jitter
    • Custom backoff strategies
  • Worker System: Easy-to-use worker trait for implementing job processors
  • State Management: Context-based state sharing between jobs and workers
  • PostgreSQL Integration: Built-in support for PostgreSQL as the job storage backend

Usage

Add to Cargo.toml:

ishikari = "0.1.0"

Creating a Job and implementing Worker

use ishikari::prelude::*;

#[derive(Debug)]
#[ishikari::job]
struct MyJob {
    // Your worker state here
}

#[ishikari::worker]
impl Worker for MyJob {
    async fn perform(&self, _ctx: Context) -> PerformResult {
        // Your job processing logic here
        Complete::default().into()
    }
}

Running Jobs

use ishikari::prelude::*;

async fn schedule_job(worker: MyJob) -> Result<Job, sqlx::Error> {
    let job = ishikari::insert(worker, &pool).await?;
    Ok(job)
}

License

MIT License

Commit count: 18

cargo fmt