🏗️ Architecture Overview
Dispytch is a lightweight, async-first event-handling framework built with composability and extensibility in mind. Here’s a breakdown of its core architecture.
🧩 Core Components
🔖 EventBase
Base class for all events.
Each event is a typed Pydantic model enriched with metadata like __topic__
and __event_type__
to control where and
how it gets published and consumed.
1 2 3 4 5 6 |
|
📤 EventEmitter
Handles outbound events. Wraps a backend-specific producer (Kafka, RabbitMQ, etc.), handles serialization and topic resolution:
1 2 3 4 5 6 |
|
🧠 HandlerGroup
A registry for event handlers. Lets you organize handlers by topic and event type.
1 2 3 4 5 6 7 8 9 10 11 |
|
📥 EventListener
Handles inbound events. Consumes events from a backend and dispatches them to relevant handlers—fully async.
1 2 3 4 5 6 |
|