strev 0.6.0

Event-driven pub/sub messaging library with compile-time ack safety
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use async_trait::async_trait;

use crate::error::{CloseError, PublishError};
use crate::message::{Message, Pending};
use crate::outcome::Outcome;
use crate::topic::Topic;

#[async_trait]
pub trait Publisher: Send + Sync {
    async fn publish(
        &self,
        topic: &Topic,
        messages: Vec<Message<Pending>>,
    ) -> Result<Vec<Outcome>, PublishError>;

    async fn close(&mut self) -> Result<(), CloseError>;
}