steady/backends/mod.rs
1pub(crate) mod memory;
2pub(crate) mod redis;
3
4use crate::{jobs::JobDefinition, QueueName, Result};
5use std::num::NonZeroUsize;
6
7#[async_trait::async_trait]
8pub trait Backend: Clone + Send + Sync {
9 async fn enqueue(&self, job_def: &JobDefinition) -> Result<()>;
10 async fn pull(&self, queue: &QueueName, count: NonZeroUsize) -> Result<Vec<JobDefinition>>;
11}