Crates.io | aj |
lib.rs | aj |
version | 0.7.0 |
source | src |
created_at | 2023-12-10 09:48:59.537778 |
updated_at | 2024-10-30 12:39:57.836279 |
description | Background Job based on Actix |
homepage | |
repository | https://github.com/cptrodgers/aj |
max_upload_size | |
id | 1064109 |
size | 39,769 |
Aj is a simple, customize-able, and feature-rich background job processing library for Rust, backed by Actix (Actor Model).
use aj::job;
#[job]
fn hello(number: i32, number2: i32) {
println!("Hello {} {number2}", number);
}
#[job]
async fn async_hello(number: i32, number2: i32) {
// We support async fn as well
println!("Hello {} {number2}", number);
}
#[main]
async fn main() {
// Start AJ engine
AJ::quick_start();
// Wait the job is registered in AJ
let _ = hello::run(1, 2).await;
// Or fire and forget it
let _ = async_hello::just_run(3, 4);
// Sleep 1 ms to view the result from job
sleep(Duration::from_secs(1)).await;
}
Job Types:
Manage Job:
Retry
should_retry
logic.Backend (Broker + Storage)
Backend
trait. In memory ExampleProcessing Speed Customization
DAG
Distributed
Dashboard & Other