Skip to main content

Crate celers_backend_db

Crate celers_backend_db 

Source
Expand description

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;

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?;

Re-exports§

pub use event_persistence::DbEventPersister;
pub use event_persistence::DbEventPersisterConfig;

Modules§

event_persistence
Database-backed event persistence for CeleRS
result_store
ResultStore implementation for Database backends

Structs§

ChordState
Chord state (for barrier synchronization)
MysqlResultBackend
MySQL result backend implementation
PostgresResultBackend
PostgreSQL result backend implementation
TaskMeta
Task metadata stored in result backend
TaskTtlConfig
Per-task-type TTL configuration for result expiration

Enums§

BackendError
Result backend errors
TaskResult
Task result state

Traits§

ResultBackend
Result backend trait

Type Aliases§

Result