Database result backend for CeleRS
This crate provides PostgreSQL and MySQL-based storage for task results and workflow state.
Features
- Task result storage with expiration
- Chord state management (barrier synchronization)
- Atomic counter operations
- SQL-based result queries and analytics
- Support for both PostgreSQL and MySQL
Example
use celers_backend_db::PostgresResultBackend;
use celers_backend_redis::ResultBackend;
# async fn example() -> Result<(), Box<dyn std::error::Error>> {
let mut backend = PostgresResultBackend::new("postgres://localhost/celers").await?;
backend.migrate().await?;
// Store task result
let meta = TaskMeta::new(task_id, "my_task".to_string());
backend.store_result(task_id, &meta).await?;
# Ok(())
# }