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:
parent
f68e332c1f
commit
855bde2a4c
|
@ -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>>;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue