ruststream 0.7.3

Async messaging framework for Rust: broker-agnostic traits, router, codecs, and a conformance harness for broker authors.
Documentation
//! The tutorial's service at step 4 without the `macros` feature: the reply handler mounted next
//! to the plain one, still without the router of step 5.
//!
//! ```text
//! cargo run --example manual_tutorial_reply_app --no-default-features --features memory,json,asyncapi
//! ```

mod orders;

use std::error::Error;

use ruststream::memory::prelude::*;

// --8<-- [start:reply]
use crate::orders::{Confirm, Receive};

fn app() -> RustStream {
    RustStream::new(AppInfo::new("orders-service", "0.1.0")).with_broker(MemoryBroker::new(), |b| {
        b.include(subscriber("orders", Receive).build());
        // The definition names the reply's destination; with no `.out_reply(..)` at the mount
        // site the reply leaves through the broker's default publisher.
        b.include(
            subscriber("orders", Confirm)
                .reply()
                .to("confirmations")
                .build(),
        );
    })
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    app().run().await?;
    Ok(())
}
// --8<-- [end:reply]