AIDispatcher 1.0.0
dotnet add package AIDispatcher --version 1.0.0
NuGet\Install-Package AIDispatcher -Version 1.0.0
<PackageReference Include="AIDispatcher" Version="1.0.0" />
<PackageVersion Include="AIDispatcher" Version="1.0.0" />
<PackageReference Include="AIDispatcher" />
paket add AIDispatcher --version 1.0.0
#r "nuget: AIDispatcher, 1.0.0"
#:package AIDispatcher@1.0.0
#addin nuget:?package=AIDispatcher&version=1.0.0
#tool nuget:?package=AIDispatcher&version=1.0.0
AIDispatcher
Modern, modular, and extensible CQRS Dispatcher for .NET 8+
🚀 AIDispatcher: CQRS & Notification Pipeline for .NET 8+
AIDispatcher adalah library .NET open-source untuk CQRS, Pipeline Behavior, dan Notification Dispatcher modern — terinspirasi MediatR, namun lebih modular, lebih fleksibel, dan lebih mudah dikembangkan.
💡 Integrasi & Kompatibilitas
AIDispatcher mengadopsi interface dan pola standar CQRS yang sudah umum di komunitas .NET (IRequest, INotification, dll), sehingga mudah diadopsi untuk proyek baru maupun migrasi dari solusi lain. Semua pipeline dan behavior bersifat modular, dapat diaktifkan atau dikustomisasi sesuai kebutuhan aplikasi.
✨ Fitur Utama
- Pipeline Behavior Modular: Logging, Retry, Timeout, Circuit Breaker, Exception Handling, Performance Monitoring, Pre/Post Processor
- Notification Dispatcher: Parallel & Sequential, Prioritas Handler (
WithPriority
), pipeline untuk logging, timeout, retry, dsb - Request Dispatcher (CQRS): Handler dengan Response & Void, pipeline modular
- Extensible & Plug & Play: Mudah menambah pipeline/behavior via DI
- Dokumentasi XML lengkap (Bahasa Indonesia): semua public API terdokumentasi untuk IntelliSense
📦 Instalasi
Install via NuGet:
dotnet add package AIDispatcher
⚡ Registrasi Dispatcher
// WAJIB - Registrasi inti AIDispatcher (handler, pipeline dasar, auto scan)
builder.Services.AddAIDispatcherCore();
// OPSIONAL - Aktifkan pipeline lanjutan (retry, timeout, circuit breaker, dsb)
builder.Services.AddAIDispatcherAdvanced();
// OPSIONAL - Konfigurasi global
// builder.Services.Configure<DispatcherOptions>(opt => { ... });
🏷️ Attribute Support
[WithPriority(int)]
Tentukan prioritas handler notification (angka lebih kecil = prioritas lebih tinggi).
[WithTimeout(int ms)]
Batasi waktu maksimal eksekusi handler/notification (overrides default timeout).
🛠️ Contoh Penggunaan
Request Handler (CQRS)
public class GetOrderQuery : IRequest<OrderDto>
{
public int Id { get; set; }
}
public class GetOrderHandler : IRequestHandler<GetOrderQuery, OrderDto>
{
public Task<OrderDto> Handle(GetOrderQuery request, CancellationToken cancellationToken)
{
// Query ke database atau source data lain
return Task.FromResult(new OrderDto { ... });
}
}
// Kirim request
var order = await dispatcher.Send<GetOrderQuery, OrderDto>(new GetOrderQuery { Id = 1 });
⚡ Pipeline Built-in
Logging: Catat request, notifikasi, dan durasi eksekusi
Retry: Otomatis ulangi jika gagal (Polly)
Timeout: Batasi waktu maksimal eksekusi
Circuit Breaker: Putus eksekusi jika error berturut-turut
Performance: Warning jika eksekusi lambat
Pre/Post Processor: Hook sebelum/sesudah handler berjalan
Exception Handling: Tangani error secara global
Notification Priority: Eksekusi handler sesuai prioritas
🆚 Fitur
Fitur | AIDispatcher |
---|---|
Request/Response | ✔️ |
Notification/Publish | ✔️ |
Pipeline Modular | ✔️ |
Logging/Performance Pipeline | ✔️ |
Retry/Circuit Breaker/Polly | ✔️ |
Exception Handling Pipeline | ✔️ |
Notification Priority | ✔️ |
Notification Parallel/Seq | ✔️ |
XML Doc Bahasa Indonesia | ✔️ |
Extensible Pipeline | ✔️ |
DI Friendly | ✔️ |
Blazor Friendly | ✔️ |
📚 Lisensi
MIT © 2025 Gani Putras Kontribusi & feedback sangat diterima!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.7)
- Microsoft.Extensions.Logging (>= 9.0.7)
- Polly (>= 8.6.2)
- Scrutor (>= 6.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0 | 470 | 7/24/2025 |
Versi 1.0.0 AIDispatcher:
- Dukungan Command, Query, Notification
- Pipeline modular: Logging, Validasi, Retry
- Eksekusi Notifikasi Paralel dan Prioritas