Rystem.Queue 6.0.16

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rystem.Queue --version 6.0.16                
NuGet\Install-Package Rystem.Queue -Version 6.0.16                
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="Rystem.Queue" Version="6.0.16" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rystem.Queue --version 6.0.16                
#r "nuget: Rystem.Queue, 6.0.16"                
#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.
// Install Rystem.Queue as a Cake Addin
#addin nuget:?package=Rystem.Queue&version=6.0.16

// Install Rystem.Queue as a Cake Tool
#tool nuget:?package=Rystem.Queue&version=6.0.16                

Queue

You have to configure it in DI BackgroundJobCronFormat is the CRON for background job that checks if Maximum buffer is exceeded or has a retention expired, usually is lesser than or equal of MaximumRetentionCronFormat. MaximumRetentionCronFormat is the CRON for maximum time before to empty the queue and call the IQueueManager<T>. MaximumBuffer is the maximum queue length before to empty the queue and call the IQueueManager<T>.

services.AddMemoryQueue<Sample, SampleQueueManager>(x =>
    {
        x.MaximumBuffer = 1000;
        x.MaximumRetentionCronFormat = "*/3 * * * * *";
        x.BackgroundJobCronFormat = "*/1 * * * * *";
    });

public class SampleQueueManager : IQueueManager<Sample> 
{
    public Task ManageAsync(IEnumerable<Sample> items)
    {
        return Task.CompletedTask;
    }
}

For instance, in the example above you have a maximum queue length of 1000, a background job thatc checks every 1 second if there are 1000 or more items or maximum retention period of 3 seconds is expired. after the build you have to warm up

var app = builder.Build();
await app.Services.WarmUpAsync();

and inject to use it

var queue = _serviceProvider.GetService<IQueue<Sample>>()!;
for (int i = 0; i < 100; i++)
    await queue.AddAsync(new Sample() { Id = i.ToString() });

In this example, after 1000 elements or 3 seconds the configured actions will be fired and the queue will be emptied.

Stack (Last In First Out)

services.AddMemoryStackQueue<Sample, SampleQueueManager>(x =>
    {
        x.MaximumBuffer = 1000;
        x.MaximumRetentionCronFormat = "*/3 * * * * *";
        x.BackgroundJobCronFormat = "*/1 * * * * *";
    });

Custom integration

If you want to use a distributed queue like storage queue, or event hub or service bus or event grid, you can write your own integration and configure it.

services.AddQueueIntegration<Sample, SampleQueueManager, YourQueueIntegration>(x =>
    {
        x.MaximumBuffer = 1000;
        x.MaximumRetentionCronFormat = "*/3 * * * * *";
        x.BackgroundJobCronFormat = "*/1 * * * * *";
    });
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. 
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
9.0.0 54,021 11/16/2024
9.0.0-rc.1 74 10/18/2024
6.2.0 218,936 10/10/2024
6.1.1 87 10/9/2024
6.1.0 47,818 9/29/2024
6.0.24 121 9/11/2024
6.0.23 118 7/18/2024
6.0.21 110 6/18/2024
6.0.20 118 6/16/2024
6.0.19 99 6/14/2024
6.0.18 95 6/14/2024
6.0.17 113 6/14/2024
6.0.16 98 6/10/2024
6.0.15 102 6/9/2024
6.0.14 121 5/24/2024
6.0.13 116 5/23/2024
6.0.12 100 5/23/2024
6.0.11 111 5/20/2024
6.0.9 108 5/20/2024
6.0.7 97 5/18/2024
6.0.6 113 5/10/2024
6.0.5 113 5/10/2024
6.0.4 111 4/3/2024
6.0.3 116 3/25/2024
6.0.2 2,357 3/11/2024
6.0.0 219 11/21/2023
6.0.0-rc.6 102 10/25/2023
6.0.0-rc.5 78 10/25/2023
6.0.0-rc.4 71 10/23/2023
6.0.0-rc.3 66 10/19/2023
6.0.0-rc.2 75 10/18/2023
6.0.0-rc.1 75 10/16/2023
5.0.20 160 9/25/2023
5.0.19 155 9/10/2023
5.0.18 140 9/6/2023
5.0.17 145 9/6/2023
5.0.16 135 9/5/2023
5.0.15 133 9/5/2023
5.0.14 129 9/5/2023
5.0.13 128 9/1/2023
5.0.12 135 8/31/2023
5.0.11 130 8/30/2023
5.0.10 163 8/29/2023
5.0.9 154 8/24/2023
5.0.8 145 8/24/2023
5.0.7 138 8/23/2023
5.0.6 149 8/21/2023
5.0.5 138 8/21/2023
5.0.4 154 8/16/2023
5.0.3 161 8/2/2023
5.0.2 158 8/2/2023
5.0.1 161 8/1/2023
5.0.0 174 7/31/2023
4.1.26 183 7/20/2023
4.1.25 173 7/16/2023
4.1.24 238 6/13/2023
4.1.23 153 6/13/2023
4.1.22 155 5/30/2023
4.1.21 152 5/20/2023
4.1.20 315,146 4/19/2023
4.1.19 94,883 3/20/2023
4.1.18 213 3/20/2023
4.1.17 202 3/17/2023
4.1.16 206 3/16/2023
4.1.15 201 3/15/2023
4.1.14 769 3/9/2023
4.1.13 217 3/7/2023
4.1.12 265 2/10/2023
4.1.11 279 1/26/2023
4.1.10 305 1/22/2023
4.1.9 298 1/20/2023
4.1.8 289 1/18/2023
4.1.7 283 1/18/2023
4.1.6 282 1/17/2023
4.1.1 308 1/4/2023
4.1.0 296 12/30/2022
3.0.25 305 12/21/2022
3.0.24 326 11/18/2022
3.0.23 327 11/18/2022
3.0.22 328 11/15/2022
3.0.21 318 11/14/2022
3.0.20 349 11/13/2022
3.0.19 369 11/2/2022
3.0.18 355 11/2/2022
3.0.17 375 10/29/2022
3.0.16 368 10/29/2022
3.0.15 381 10/29/2022
2.0.6 417 9/20/2022
2.0.5 403 9/20/2022
2.0.3 431 9/20/2022
2.0.1 489 9/13/2022
2.0.0 415 8/19/2022
1.1.22 464 7/30/2022
1.1.21 421 7/29/2022
1.1.20 416 7/29/2022
1.1.19 441 7/29/2022
1.1.18 445 7/27/2022
1.1.17 447 7/27/2022
1.1.15 439 7/25/2022
1.1.14 440 7/25/2022
1.1.13 431 7/22/2022
1.1.12 422 7/19/2022
1.1.11 443 7/19/2022
1.1.10 436 7/19/2022
1.1.9 461 7/19/2022
1.1.8 435 7/18/2022
1.1.7 453 7/18/2022
1.1.6 415 7/18/2022
1.0.4 444 7/17/2022
1.0.3 440 7/17/2022
1.0.2 441 7/12/2022
1.0.1 500 7/12/2022
1.0.0 458 7/8/2022
0.10.7 454 7/8/2022
0.9.11 433 7/1/2022
0.9.10 437 6/29/2022
0.9.9 443 6/29/2022