chore(worker): introduce an abstraction for streaming-based publish workers

Some things doesn't need to receive data, just to push!

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
raito 2024-11-14 22:51:57 +01:00
parent f68e332c1f
commit 855bde2a4c

View file

@ -1,5 +1,6 @@
use std::marker::Send;
use futures::Stream;
use serde::Serialize;
pub struct Response {}
@ -68,3 +69,7 @@ pub trait SimpleWorker: Send {
body: &[u8],
) -> Result<Self::J, String>;
}
pub trait StreamWorker: Send {
fn publisher(&mut self, chan: &mut lapin::Channel) -> impl Stream<Item = Box<QueueMsg>>;
}