| Crates.io | buzzard |
| lib.rs | buzzard |
| version | 0.1.0 |
| created_at | 2025-07-20 13:05:28.501811+00 |
| updated_at | 2025-07-20 13:05:28.501811+00 |
| description | A lightweight, DDD-first message bus framework for Rust β orchestrate commands, events, and projections with confidence. |
| homepage | |
| repository | https://github.com/award28/buzzard |
| max_upload_size | |
| id | 1761044 |
| size | 46,558 |
A lightweight, DDD-first message bus framework for Rust β orchestrate commands, events, and projections with confidence.
buzzard is a strongly typed, domain-driven orchestration framework for message-based applications in Rust. Inspired by hexagonal and DDD patterns, it lets you model business flows with explicit Command, Event, and Projection types while remaining infrastructure-agnostic.
Send + Sync + Clone safeRedis, Postgres, NATS, etc.)MessageBusDriver, CommandHandler, Policy, and Projector#[tokio::main]
async fn main() -> Result<()> {
let driver = MyDriver::init().await?;
let bus = MessageBus::from(&driver);
// Run bus in the background
let background = tokio::spawn(bus.clone().start());
// Dispatch a command from a web handler, CLI, etc.
let cmd = MyCommand { sku: "ABC-123".into() };
let response = bus.dispatch(cmd).await?;
background.await??;
Ok(())
}
ββββββββββββββββββββββββββ
β Message Bus β
ββββββββββββββ¬ββββββββββββ
β
ββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββββββββββββ ββββββββββββββββββββββ
β Command Msg β β Event Msg β β Projection Msg β
ββββββββ¬βββββββββ βββββββββββ¬ββββββββββββ ββββββββββββ¬ββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββ ββββββββββββββββββββββ ββββββββββββββββββββββββββ
β CommandHandlerβ β Policy β β Projector β
ββββββββ¬βββββββββ ββββββββββ¬ββββββββββββ βββββββββββββ¬βββββββββββββ
β domain mutation β maps event to side effects β
βΌ βΌ β
ββββββββββββββββββββββ ββββββββββββββββββββββββββββββ β
β UnitOfWork β β Vec<SideEffect<Cmd, Proj>> β β
β - apply mutations β βββββββββββββββ¬βββββββββββββββ β
β - capture events β β β
β - commit/rollback β β β
βββββββββββ¬βββββββββββ β β
β commits β publishes β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
β Event Msg(s) βββββββββΊβ Message Bus (loopback) β β Projection Msgs from Policy β
ββββββββββββββββ ββββββββββββββββββββββββββββββ βββββββββββββββββββββββββββββββ
| Trait | Description |
|---|---|
MessageBusDriver |
Declares domain types + infrastructure |
CommandHandler |
Executes domain logic with mutation |
Policy |
Reacts to events with follow-up messages |
Projector |
Handles read model and infra updates |
dispatch(command) β handled in UnitOfWorkPolicy logic β follow-up messagesProjectorfutures, anyhow