AIDispatcher 1.0.0

dotnet add package AIDispatcher --version 1.0.0
                    
NuGet\Install-Package AIDispatcher -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AIDispatcher" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AIDispatcher" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AIDispatcher" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AIDispatcher --version 1.0.0
                    
#r "nuget: AIDispatcher, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AIDispatcher@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AIDispatcher&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AIDispatcher&version=1.0.0
                    
Install as a Cake Tool

AIDispatcher Logo

AIDispatcher

Modern, modular, and extensible CQRS Dispatcher for .NET 8+

NuGet License: MIT

🚀 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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