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
use async_trait::async_trait;

use crate::error::{CloseError, SubscribeError};
use crate::stream::MessageStream;
use crate::topic::Topic;

#[async_trait]
pub trait Subscriber: Send + Sync {
    async fn subscribe(&self, topic: &Topic) -> Result<MessageStream, SubscribeError>;

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