use ruststream::memory::MemoryBroker;
use ruststream::runtime::{AppInfo, HandlerOutcome, RustStream};
use ruststream::subscriber;
use serde::Deserialize;
#[derive(Deserialize)]
struct Order {
id: u32,
}
// The signature asks for a batch; how big a batch is has no default, so the mount site owes one.
#[subscriber("orders")]
async fn handle(orders: &[Order]) -> HandlerOutcome {
let _ = orders.len();
HandlerOutcome::ack()
}
fn main() {
let _app =
RustStream::new(AppInfo::new("app", "0.1.0")).with_broker(MemoryBroker::new(), |b| {
b.include(handle);
});
}