event_base 0.1.0

An Event Driven Framework
Documentation
# EventBase

> <div style="text-align: center;">Stop wiring channels. Start orchestrating events.</div>
>
> **A type-safe, macro-driven event-driven framework for Rust applications.**

**What it is:**
`event_base` is a lightweight, macro-driven event-driven framework for building reliable, observable, and scalable applications in Rust. With `event_base`, you declare handlers, chain middleware, and define reliable workflowsβ€”all at compile time.

**What it is not:**
event_base is not a distributed message queue. It does not transport data between services. I`event_base` focuses on **orchestrating events inside your application**: defining events, declaring handlers, managing state, and ensuring reliability.

## ✨ Features

- **πŸ”’ Type-safe events** β€” Define events as plain Rust structs. The compiler guarantees correctness.
- **πŸ”Œ Pluggable backends** β€” `memory` (flume), `file`, `redis`, `kafka`, `mqtt`. Swap without changing your handlers.
- **⚑ Macro-driven DX** β€” `#[handler]` turns any async function into a message handler. No boilerplate.
- **πŸ“¦ Multiple delivery modes** β€” Standard (competing consumers), Broadcast (all workers), and Repeated (N times).
- **πŸ’Ύ Application-level WAL** β€” Durable persistence with crash recovery. Your events survive restarts.
- **πŸ”„ Automatic retry & Dead Letter Queue** β€” Failed messages retry with configurable backoff, then land in DLQ.
- **πŸ“Š Built-in observability** β€” Audit logging (`_system.audit`) and distributed tracing (`_system.trace`) enabled by default.
- **🎯 Middleware support** β€” Compose logging, metrics, retries, and custom logic via middleware pipeline.
- **🌐 Distributed-ready** β€” Host/Worker node model with built-in discovery and shutdown coordination.
- **πŸ›‘ Graceful shutdown** β€” 7 shutdown strategies, including two-stage drain and force timeout.
- **🧩 gRPC management API** β€” Query node status, list workers, trigger shutdown, stream metrics.

## ⭐ Why event_base?

  In Rust, you have message queue clients (`lapin`, `rdkafka`) and event sourcing libraries (`eventastic`, `sourcerer`). But nothing bridges the gap β€” **application-level event orchestration with macro-driven DX** and **enterprise-grade reliability built in**.

  `event_base` is for you if:

  - You want type-safe, compile-time guaranteed event handlers.
  - You need persistence and crash recovery without running a separate message broker.
  - You want observability (audit + trace) enabled by default, not as an afterthought.
  - You're building a Rust application and want **the best developer experience** for event-driven architecture.

## 🏭 Production Ready

- **Dogfooded** β€” We use `event_base` in my next project. It won't be abandoned.
- **Auditable** β€” Every line is human-written, reviewable, and explainable. ***No vibe coding.***
- **Long-term maintenance** β€” This is not a side project. We depend on it too.

## πŸ“š Documentation

- [API Reference]TODO
- [Architecture Guide]TODO
- [Template - Normal]TODO
- [Template - Slint]TODO

## 🧩 Templates

Get started in seconds with `cargo generate`:

```bash
cargo install cargo-generate

# Core template
cargo generate --git TODO

# GUI template (Slint + event_base)
cargo generate --git TODO
```

## 🀝 Contributing

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

## πŸ“„ License

See the [LICENSE](LICENSE) file for details.

---

*Built with ❀️ by RedElectricity.*