Rystem.Queue
6.0.11
See the version list below for details.
dotnet add package Rystem.Queue --version 6.0.11
NuGet\Install-Package Rystem.Queue -Version 6.0.11
<PackageReference Include="Rystem.Queue" Version="6.0.11" />
paket add Rystem.Queue --version 6.0.11
#r "nuget: Rystem.Queue, 6.0.11"
// Install Rystem.Queue as a Cake Addin #addin nuget:?package=Rystem.Queue&version=6.0.11 // Install Rystem.Queue as a Cake Tool #tool nuget:?package=Rystem.Queue&version=6.0.11
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 | 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. |
-
net8.0
- Rystem.BackgroundJob (>= 6.0.11)
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.24 | 86 | 9/11/2024 |
6.0.23 | 93 | 7/18/2024 |
6.0.21 | 89 | 6/18/2024 |
6.0.20 | 96 | 6/16/2024 |
6.0.19 | 83 | 6/14/2024 |
6.0.18 | 79 | 6/14/2024 |
6.0.17 | 91 | 6/14/2024 |
6.0.16 | 79 | 6/10/2024 |
6.0.15 | 83 | 6/9/2024 |
6.0.14 | 99 | 5/24/2024 |
6.0.13 | 95 | 5/23/2024 |
6.0.12 | 78 | 5/23/2024 |
6.0.11 | 93 | 5/20/2024 |
6.0.9 | 88 | 5/20/2024 |
6.0.7 | 76 | 5/18/2024 |
6.0.6 | 97 | 5/10/2024 |
6.0.5 | 89 | 5/10/2024 |
6.0.4 | 92 | 4/3/2024 |
6.0.3 | 95 | 3/25/2024 |
6.0.2 | 2,052 | 3/11/2024 |
6.0.0 | 200 | 11/21/2023 |
6.0.0-rc.6 | 94 | 10/25/2023 |
6.0.0-rc.5 | 71 | 10/25/2023 |
6.0.0-rc.4 | 63 | 10/23/2023 |
6.0.0-rc.3 | 61 | 10/19/2023 |
6.0.0-rc.2 | 68 | 10/18/2023 |
6.0.0-rc.1 | 67 | 10/16/2023 |
5.0.20 | 140 | 9/25/2023 |
5.0.19 | 131 | 9/10/2023 |
5.0.18 | 118 | 9/6/2023 |
5.0.17 | 125 | 9/6/2023 |
5.0.16 | 117 | 9/5/2023 |
5.0.15 | 110 | 9/5/2023 |
5.0.14 | 110 | 9/5/2023 |
5.0.13 | 105 | 9/1/2023 |
5.0.12 | 118 | 8/31/2023 |
5.0.11 | 102 | 8/30/2023 |
5.0.10 | 143 | 8/29/2023 |
5.0.9 | 132 | 8/24/2023 |
5.0.8 | 124 | 8/24/2023 |
5.0.7 | 119 | 8/23/2023 |
5.0.6 | 130 | 8/21/2023 |
5.0.5 | 119 | 8/21/2023 |
5.0.4 | 134 | 8/16/2023 |
5.0.3 | 137 | 8/2/2023 |
5.0.2 | 138 | 8/2/2023 |
5.0.1 | 133 | 8/1/2023 |
5.0.0 | 154 | 7/31/2023 |
4.1.26 | 165 | 7/20/2023 |
4.1.25 | 151 | 7/16/2023 |
4.1.24 | 221 | 6/13/2023 |
4.1.23 | 133 | 6/13/2023 |
4.1.22 | 130 | 5/30/2023 |
4.1.21 | 133 | 5/20/2023 |
4.1.20 | 315,127 | 4/19/2023 |
4.1.19 | 94,866 | 3/20/2023 |
4.1.18 | 191 | 3/20/2023 |
4.1.17 | 185 | 3/17/2023 |
4.1.16 | 183 | 3/16/2023 |
4.1.15 | 183 | 3/15/2023 |
4.1.14 | 754 | 3/9/2023 |
4.1.13 | 197 | 3/7/2023 |
4.1.12 | 241 | 2/10/2023 |
4.1.11 | 261 | 1/26/2023 |
4.1.10 | 287 | 1/22/2023 |
4.1.9 | 278 | 1/20/2023 |
4.1.8 | 275 | 1/18/2023 |
4.1.7 | 266 | 1/18/2023 |
4.1.6 | 262 | 1/17/2023 |
4.1.1 | 288 | 1/4/2023 |
4.1.0 | 273 | 12/30/2022 |
3.0.25 | 282 | 12/21/2022 |
3.0.24 | 306 | 11/18/2022 |
3.0.23 | 307 | 11/18/2022 |
3.0.22 | 306 | 11/15/2022 |
3.0.21 | 297 | 11/14/2022 |
3.0.20 | 329 | 11/13/2022 |
3.0.19 | 350 | 11/2/2022 |
3.0.18 | 334 | 11/2/2022 |
3.0.17 | 358 | 10/29/2022 |
3.0.16 | 349 | 10/29/2022 |
3.0.15 | 365 | 10/29/2022 |
2.0.6 | 395 | 9/20/2022 |
2.0.5 | 383 | 9/20/2022 |
2.0.3 | 412 | 9/20/2022 |
2.0.1 | 471 | 9/13/2022 |
2.0.0 | 395 | 8/19/2022 |
1.1.22 | 438 | 7/30/2022 |
1.1.21 | 400 | 7/29/2022 |
1.1.20 | 394 | 7/29/2022 |
1.1.19 | 421 | 7/29/2022 |
1.1.18 | 424 | 7/27/2022 |
1.1.17 | 426 | 7/27/2022 |
1.1.15 | 418 | 7/25/2022 |
1.1.14 | 420 | 7/25/2022 |
1.1.13 | 408 | 7/22/2022 |
1.1.12 | 400 | 7/19/2022 |
1.1.11 | 421 | 7/19/2022 |
1.1.10 | 418 | 7/19/2022 |
1.1.9 | 438 | 7/19/2022 |
1.1.8 | 411 | 7/18/2022 |
1.1.7 | 434 | 7/18/2022 |
1.1.6 | 398 | 7/18/2022 |
1.0.4 | 423 | 7/17/2022 |
1.0.3 | 417 | 7/17/2022 |
1.0.2 | 423 | 7/12/2022 |
1.0.1 | 479 | 7/12/2022 |
1.0.0 | 435 | 7/8/2022 |
0.10.7 | 432 | 7/8/2022 |
0.9.11 | 413 | 7/1/2022 |
0.9.10 | 416 | 6/29/2022 |
0.9.9 | 426 | 6/29/2022 |