Rystem.Queue 0.10.7

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

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

Queue

You have to configure it in DI

services.AddMemoryQueue<Sample>(x =>
    {
        x.MaximumBuffer = 1000;
        x.Actions.Add(items =>
        {
            foreach(var item in items)
            {
                //do something
            }
            return Task.CompletedTask;
        });
        x.MaximumRetentionCronFormat = "*/3 * * * * *";
    });

For instance, in the example above you have a maximum queue lenght of 1000 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>(x =>
    {
        x.MaximumBuffer = 1000;
        x.Actions.Add(items =>
        {
            foreach(var item in items)
            {
                //do something
            }
            return Task.CompletedTask;
        });
        x.MaximumRetentionCronFormat = "*/3 * * * * *";
    });

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, YourQueueIntegration>(x =>
    {
        x.MaximumBuffer = 1000;
        x.Actions.Add(items =>
        {
            foreach(var item in items)
            {
                //do something
            }
            return Task.CompletedTask;
        });
        x.MaximumRetentionCronFormat = "*/3 * * * * *";
    });
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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
6.0.12 0 5/23/2024
6.0.11 45 5/20/2024
6.0.9 48 5/20/2024
6.0.7 40 5/18/2024
6.0.6 80 5/10/2024
6.0.5 75 5/10/2024
6.0.4 83 4/3/2024
6.0.3 85 3/25/2024
6.0.2 1,172 3/11/2024
6.0.0 191 11/21/2023
6.0.0-rc.6 79 10/25/2023
6.0.0-rc.5 63 10/25/2023
6.0.0-rc.4 54 10/23/2023
6.0.0-rc.3 53 10/19/2023
6.0.0-rc.2 59 10/18/2023
6.0.0-rc.1 60 10/16/2023
5.0.20 129 9/25/2023
5.0.19 122 9/10/2023
5.0.18 104 9/6/2023
5.0.17 115 9/6/2023
5.0.16 108 9/5/2023
5.0.15 102 9/5/2023
5.0.14 101 9/5/2023
5.0.13 96 9/1/2023
5.0.12 108 8/31/2023
5.0.11 94 8/30/2023
5.0.10 134 8/29/2023
5.0.9 126 8/24/2023
5.0.8 115 8/24/2023
5.0.7 112 8/23/2023
5.0.6 122 8/21/2023
5.0.5 111 8/21/2023
5.0.4 126 8/16/2023
5.0.3 127 8/2/2023
5.0.2 129 8/2/2023
5.0.1 126 8/1/2023
5.0.0 144 7/31/2023
4.1.26 157 7/20/2023
4.1.25 141 7/16/2023
4.1.24 210 6/13/2023
4.1.23 119 6/13/2023
4.1.22 124 5/30/2023
4.1.21 126 5/20/2023
4.1.20 315,114 4/19/2023
4.1.19 94,857 3/20/2023
4.1.18 186 3/20/2023
4.1.17 179 3/17/2023
4.1.16 178 3/16/2023
4.1.15 178 3/15/2023
4.1.14 745 3/9/2023
4.1.13 192 3/7/2023
4.1.12 232 2/10/2023
4.1.11 252 1/26/2023
4.1.10 278 1/22/2023
4.1.9 269 1/20/2023
4.1.8 265 1/18/2023
4.1.7 256 1/18/2023
4.1.6 256 1/17/2023
4.1.1 272 1/4/2023
4.1.0 263 12/30/2022
3.0.25 275 12/21/2022
3.0.24 298 11/18/2022
3.0.23 298 11/18/2022
3.0.22 297 11/15/2022
3.0.21 284 11/14/2022
3.0.20 319 11/13/2022
3.0.19 343 11/2/2022
3.0.18 324 11/2/2022
3.0.17 348 10/29/2022
3.0.16 341 10/29/2022
3.0.15 354 10/29/2022
2.0.6 387 9/20/2022
2.0.5 374 9/20/2022
2.0.3 397 9/20/2022
2.0.1 456 9/13/2022
2.0.0 385 8/19/2022
1.1.22 427 7/30/2022
1.1.21 390 7/29/2022
1.1.20 386 7/29/2022
1.1.19 411 7/29/2022
1.1.18 415 7/27/2022
1.1.17 416 7/27/2022
1.1.15 408 7/25/2022
1.1.14 410 7/25/2022
1.1.13 400 7/22/2022
1.1.12 391 7/19/2022
1.1.11 413 7/19/2022
1.1.10 408 7/19/2022
1.1.9 430 7/19/2022
1.1.8 401 7/18/2022
1.1.7 424 7/18/2022
1.1.6 389 7/18/2022
1.0.4 415 7/17/2022
1.0.3 408 7/17/2022
1.0.2 413 7/12/2022
1.0.1 469 7/12/2022
1.0.0 426 7/8/2022
0.10.7 424 7/8/2022
0.9.11 402 7/1/2022
0.9.10 405 6/29/2022
0.9.9 416 6/29/2022