Avian is a high-performance, zero-allocation event bus framework for C#. Designed for scenarios where latency and memory predictability are critical—such as game servers and real-time systems—Avian leverages compile-time code generation to eliminate runtime overhead.
| Component | Responsibility |
|---|---|
| Avian.Core | Memory management (RingBuffer, Pools) |
| Avian.Event | Event brokering & Dispatching |
| Avian.SourceGen | Compile-time optimization (Roslyn) |
"Don't let the Garbage Collector hold you back."
- Zero-Allocation: Built for high-frequency loops. No hidden
newobjects. - Compile-Time Magic: Uses Roslyn Source Generators to write the "bridge code" for you.
- Predictable: Full control over dispatching via manual
Execute()cycles.
| Feature | MediatR | Avian |
|---|---|---|
| Reflection | Yes | No |
| Allocation | High | Zero |
| Runtime Speed | Moderate | Maximum |
using Avian;
public struct PlayerMoveEvent : IEvent
{
public int X, Y;
}