mq 0.30.0

Simple Message Queue
Documentation
1
2
3
4
5
6
7
8
9
10
11
use async_trait::async_trait;

use crate::{Error, Job};

#[async_trait]
pub trait Producer: Send + Sync {
    async fn publish(&self, job: Job) -> Result<(), Error>;
    async fn exists(&self, queue: &str, kind: &str, id: &str) -> Result<bool, Error>;
    async fn cancel_by_id(&self, queue: &str, kind: &str, id: &str) -> Result<(), Error>;
    async fn cancel_by_unique_key(&self, queue: &str, kind: &str, key: &str) -> Result<(), Error>;
}