CQRSharp.Generators 2.2.6

dotnet add package CQRSharp.Generators --version 2.2.6
                    
NuGet\Install-Package CQRSharp.Generators -Version 2.2.6
                    
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="CQRSharp.Generators" Version="2.2.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CQRSharp.Generators" Version="2.2.6" />
                    
Directory.Packages.props
<PackageReference Include="CQRSharp.Generators" />
                    
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 CQRSharp.Generators --version 2.2.6
                    
#r "nuget: CQRSharp.Generators, 2.2.6"
                    
#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 CQRSharp.Generators@2.2.6
                    
#: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=CQRSharp.Generators&version=2.2.6
                    
Install as a Cake Addin
#tool nuget:?package=CQRSharp.Generators&version=2.2.6
                    
Install as a Cake Tool

A set of Roslyn source code generators that allow Native AoT compatibility for the CQRSharp Library.

There are no supported framework assets in this 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
2.2.6 176 4/20/2025
2.2.5 154 4/11/2025
2.2.4 162 4/7/2025
2.2.3.1 168 3/11/2025
2.2.3 175 3/10/2025
2.2.2 212 3/8/2025

Version 2.2.6 (2025‑04‑20)
           
           Breaking Changes
           - `QueueBackgroundWorkItemAsync` now returns `Task<QueueWriteResult>` instead of a fire‑and‑forget `Task`.
           - `IBackgroundTaskQueue` no longer exposes `OnTaskEnqueued`/`OnTaskRejected` events; use the notification channel.
           - `BackgroundTaskQueue.DequeueAsync` signature changed to `ValueTask<QueuedTask>`.
           - `BackgroundTaskQueueOptions.DequeueBatchSize` deprecated in favor of `CallbackChannelCapacity` and `ShutdownTimeout`.
           - All `.ContinueWith` usage in the Dispatcher was replaced by `async`/`await`, preserving stack traces and the `SynchronizationContext`.
           
           Added
           - **Dispatcher**: `EnqueueAndWatchAsync` helper; simplified `finalHandlerWrapper` logic.
           - **DI Extensions**: `CqrsStartupLogger` (`IHostedService`) & `CqrsRegistrationInfo` for deferred CQRS‑registration logging.
           - **RateLimiter**: `ShardedLruCache` with per‑shard LRU eviction; implements `IDisposable` to tear down the cleanup timer.
           - **BackgroundTaskQueue**:
             - `QueuedTask` struct (with `QueueId`, `SequenceNumber`, `EnqueueTime`) and `QueueWriteResult` struct.
             - Built‑in metrics: `TotalItemsEnqueued`, `TotalDroppedNewest`, `TotalDroppedOldest`.
             - Dedicated notification channel via `INotificationDispatcher`.
             - `CountingChannelReader` for atomic queue‑depth tracking.
           - **BackgroundTaskQueueConsumer**: single loop gated by a `SemaphoreSlim` (`ConsumerCount`); lifecycle logging; `ShutdownTimeout` support.
           
           Changed
           - **Dispatcher**: `ExecuteCommand` now returns a `Task` immediately in async mode.
           - **RateLimiter**:
             - Corrected refill formula to apply `replenishRatePerSecond` directly.
             - High‑precision timing via `Stopwatch.GetTimestamp()`.
             - Sliding‑expiration cleanup via explicit snapshot and background timer.
           - **BackgroundTaskQueue**:
             - Consolidated multi‑shard design into a single bounded `Channel<QueuedTask>`.
             - Explicit implementation of all `BoundedChannelFullMode` policies (`Wait`, `DropNewest`, `DropOldest`, `Throw`).
             - Replaced manual `WaitToReadAsync` and`TryRead` loops with `ReadAllAsync()`.
             - Refactored notification dispatch into `ProcessNotificationsAsync` with retry parameters.
           
           Removed
           - All `.ContinueWith` calls; static CQRS‑registrar logging at DI setup.
           - Third‑party/`MemoryCache` dependencies in `RateLimiter`.
           - Busy‑wait loops and redundant `Task.Run` calls in the background queue.
           - Public `OnTaskEnqueued`/`OnTaskRejected` events on `IBackgroundTaskQueue`.
           
           Fixed
           - Race conditions in `DropOldest`/`DropNewest` policies under contention.
           - Cancellation and exception propagation in `Dispatcher.EnqueueAndWatchAsync`.
           - Timer leak in `RateLimiter` by implementing `Dispose`.
           - Refill‑rate drift in token‑bucket logic; restored full exception stacks by removing `.ContinueWith`.
           
           Performance
           - **Dispatcher**: end‑to‑end `await` for context‑safe execution.
           - **RateLimiter**: sharded cache + stopwatch timing for minimal contention.
           - **BackgroundTaskQueue**: single channel + `CountingChannelReader` for lock‑free depth tracking.
           - **Consumer**: `SemaphoreSlim`‑gated loop avoids thread‑pool storms.
           
           Testing
           - **DispatcherTests**: sync/async execution, cancellation, exception‑propagation coverage.
           - **RateLimiterTests**: refill accuracy, shard eviction, timer disposal.
           - **BackgroundTaskQueueTests**: backpressure modes, FIFO ordering, metrics, high‑concurrency and graceful shutdown.
           - **RequestDispatcherTests**: host‑lifetime cancellation via `TestHostApplicationLifetime`.
           - **BackgroundTaskQueueConsumerTests**: concurrency gating and lifecycle logging.
           
           Documentation
           - Updated XML docs for new options (`EnableMetrics`, `NotificationMaxRetries`, `ShutdownTimeout`, `MetricLogInterval`).
           - Clarified defaults and valid ranges in `BackgroundTaskQueueOptions` and `RateLimiterOptions`.