Rystem.Queue
9.0.4
dotnet add package Rystem.Queue --version 9.0.4
NuGet\Install-Package Rystem.Queue -Version 9.0.4
<PackageReference Include="Rystem.Queue" Version="9.0.4" />
paket add Rystem.Queue --version 9.0.4
#r "nuget: Rystem.Queue, 9.0.4"
// Install Rystem.Queue as a Cake Addin #addin nuget:?package=Rystem.Queue&version=9.0.4 // Install Rystem.Queue as a Cake Tool #tool nuget:?package=Rystem.Queue&version=9.0.4
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 | net9.0 is compatible. |
-
net9.0
- Rystem.BackgroundJob (>= 9.0.4)
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.4 | 79,514 | 12/23/2024 |
9.0.3 | 95 | 12/22/2024 |
9.0.2 | 10,636 | 12/21/2024 |
9.0.1 | 1,120 | 12/21/2024 |
9.0.0 | 172,890 | 11/16/2024 |
9.0.0-rc.1 | 79 | 10/18/2024 |
6.2.0 | 218,948 | 10/10/2024 |
6.1.1 | 99 | 10/9/2024 |
6.1.0 | 47,830 | 9/29/2024 |
6.0.24 | 134 | 9/11/2024 |
6.0.23 | 128 | 7/18/2024 |
6.0.21 | 121 | 6/18/2024 |
6.0.20 | 131 | 6/16/2024 |
6.0.19 | 110 | 6/14/2024 |
6.0.18 | 104 | 6/14/2024 |
6.0.17 | 121 | 6/14/2024 |
6.0.16 | 106 | 6/10/2024 |
6.0.15 | 113 | 6/9/2024 |
6.0.14 | 131 | 5/24/2024 |
6.0.13 | 124 | 5/23/2024 |
6.0.12 | 109 | 5/23/2024 |
6.0.11 | 119 | 5/20/2024 |
6.0.9 | 116 | 5/20/2024 |
6.0.7 | 105 | 5/18/2024 |
6.0.6 | 121 | 5/10/2024 |
6.0.5 | 121 | 5/10/2024 |
6.0.4 | 117 | 4/3/2024 |
6.0.3 | 123 | 3/25/2024 |
6.0.2 | 2,483 | 3/11/2024 |
6.0.0 | 225 | 11/21/2023 |
6.0.0-rc.6 | 105 | 10/25/2023 |
6.0.0-rc.5 | 84 | 10/25/2023 |
6.0.0-rc.4 | 74 | 10/23/2023 |
6.0.0-rc.3 | 69 | 10/19/2023 |
6.0.0-rc.2 | 78 | 10/18/2023 |
6.0.0-rc.1 | 78 | 10/16/2023 |
5.0.20 | 166 | 9/25/2023 |
5.0.19 | 161 | 9/10/2023 |
5.0.18 | 146 | 9/6/2023 |
5.0.17 | 153 | 9/6/2023 |
5.0.16 | 141 | 9/5/2023 |
5.0.15 | 139 | 9/5/2023 |
5.0.14 | 137 | 9/5/2023 |
5.0.13 | 135 | 9/1/2023 |
5.0.12 | 143 | 8/31/2023 |
5.0.11 | 136 | 8/30/2023 |
5.0.10 | 169 | 8/29/2023 |
5.0.9 | 160 | 8/24/2023 |
5.0.8 | 151 | 8/24/2023 |
5.0.7 | 144 | 8/23/2023 |
5.0.6 | 155 | 8/21/2023 |
5.0.5 | 144 | 8/21/2023 |
5.0.4 | 160 | 8/16/2023 |
5.0.3 | 168 | 8/2/2023 |
5.0.2 | 164 | 8/2/2023 |
5.0.1 | 167 | 8/1/2023 |
5.0.0 | 180 | 7/31/2023 |
4.1.26 | 189 | 7/20/2023 |
4.1.25 | 179 | 7/16/2023 |
4.1.24 | 247 | 6/13/2023 |
4.1.23 | 159 | 6/13/2023 |
4.1.22 | 161 | 5/30/2023 |
4.1.21 | 158 | 5/20/2023 |
4.1.20 | 315,152 | 4/19/2023 |
4.1.19 | 94,889 | 3/20/2023 |
4.1.18 | 219 | 3/20/2023 |
4.1.17 | 208 | 3/17/2023 |
4.1.16 | 212 | 3/16/2023 |
4.1.15 | 208 | 3/15/2023 |
4.1.14 | 775 | 3/9/2023 |
4.1.13 | 226 | 3/7/2023 |
4.1.12 | 271 | 2/10/2023 |
4.1.11 | 285 | 1/26/2023 |
4.1.10 | 311 | 1/22/2023 |
4.1.9 | 304 | 1/20/2023 |
4.1.8 | 295 | 1/18/2023 |
4.1.7 | 289 | 1/18/2023 |
4.1.6 | 288 | 1/17/2023 |
4.1.1 | 314 | 1/4/2023 |
4.1.0 | 302 | 12/30/2022 |
3.0.25 | 311 | 12/21/2022 |
3.0.24 | 334 | 11/18/2022 |
3.0.23 | 335 | 11/18/2022 |
3.0.22 | 337 | 11/15/2022 |
3.0.21 | 326 | 11/14/2022 |
3.0.20 | 357 | 11/13/2022 |
3.0.19 | 378 | 11/2/2022 |
3.0.18 | 365 | 11/2/2022 |
3.0.17 | 383 | 10/29/2022 |
3.0.16 | 376 | 10/29/2022 |
3.0.15 | 389 | 10/29/2022 |
2.0.6 | 425 | 9/20/2022 |
2.0.5 | 411 | 9/20/2022 |
2.0.3 | 439 | 9/20/2022 |
2.0.1 | 497 | 9/13/2022 |
2.0.0 | 423 | 8/19/2022 |
1.1.22 | 472 | 7/30/2022 |
1.1.21 | 429 | 7/29/2022 |
1.1.20 | 424 | 7/29/2022 |
1.1.19 | 449 | 7/29/2022 |
1.1.18 | 455 | 7/27/2022 |
1.1.17 | 455 | 7/27/2022 |
1.1.15 | 447 | 7/25/2022 |
1.1.14 | 449 | 7/25/2022 |
1.1.13 | 439 | 7/22/2022 |
1.1.12 | 431 | 7/19/2022 |
1.1.11 | 452 | 7/19/2022 |
1.1.10 | 444 | 7/19/2022 |
1.1.9 | 470 | 7/19/2022 |
1.1.8 | 443 | 7/18/2022 |
1.1.7 | 461 | 7/18/2022 |
1.1.6 | 426 | 7/18/2022 |
1.0.4 | 452 | 7/17/2022 |
1.0.3 | 449 | 7/17/2022 |
1.0.2 | 449 | 7/12/2022 |
1.0.1 | 508 | 7/12/2022 |
1.0.0 | 466 | 7/8/2022 |
0.10.7 | 463 | 7/8/2022 |
0.9.11 | 441 | 7/1/2022 |
0.9.10 | 445 | 6/29/2022 |
0.9.9 | 451 | 6/29/2022 |