Soenneker.Utils.ConcurrentCircularQueue
4.0.99
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Utils.ConcurrentCircularQueue --version 4.0.99
NuGet\Install-Package Soenneker.Utils.ConcurrentCircularQueue -Version 4.0.99
<PackageReference Include="Soenneker.Utils.ConcurrentCircularQueue" Version="4.0.99" />
<PackageVersion Include="Soenneker.Utils.ConcurrentCircularQueue" Version="4.0.99" />
<PackageReference Include="Soenneker.Utils.ConcurrentCircularQueue" />
paket add Soenneker.Utils.ConcurrentCircularQueue --version 4.0.99
#r "nuget: Soenneker.Utils.ConcurrentCircularQueue, 4.0.99"
#:package Soenneker.Utils.ConcurrentCircularQueue@4.0.99
#addin nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=4.0.99
#tool nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=4.0.99
Soenneker.Utils.ConcurrentCircularQueue
A thread-safe collection type for a fixed length of elements, overwriting the oldest element
Installation
dotnet add package Soenneker.Utils.ConcurrentCircularQueue
Usage
Creating an Instance
Instantiate a ConcurrentCircularQueue<T> object by specifying the maximum size of the queue. Optionally, asynchronous locking is available for perfect .Contains().
// Creates a queue with a maximum size of 3.
var myQueue = new ConcurrentCircularQueue<int>(3, locking: false);
Enqueueing Items
Add an item to the queue. If the queue has reached its maximum size, the oldest item will be removed.
await myQueue.Enqueue(1);
await myQueue.Enqueue(2);
await myQueue.Enqueue(3);
await myQueue.Enqueue(4);
// The queue now contains 2, 3, and 4.
Dequeueing Items
Remove and return the oldest item from the queue.
(bool success, int result) = await myQueue.TryDequeue();
Checking If an Item Exists
Determine if a specific item is in the queue.
bool exists = await myQueue.Contains(item);
Count
Retrieve the current number of items in the queue.
int currentCount = await myQueue.Count();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Soenneker.Asyncs.Locks (>= 4.0.34)
- Soenneker.Extensions.ValueTask (>= 4.0.110)
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 |
|---|---|---|
| 4.0.113 | 340 | 4/23/2026 |
| 4.0.112 | 107 | 4/23/2026 |
| 4.0.111 | 108 | 4/23/2026 |
| 4.0.110 | 104 | 4/23/2026 |
| 4.0.109 | 134 | 3/13/2026 |
| 4.0.108 | 106 | 3/13/2026 |
| 4.0.107 | 102 | 3/13/2026 |
| 4.0.106 | 103 | 3/12/2026 |
| 4.0.105 | 107 | 3/12/2026 |
| 4.0.100 | 108 | 3/12/2026 |
| 4.0.99 | 101 | 3/12/2026 |
| 4.0.98 | 104 | 3/12/2026 |
| 4.0.96 | 105 | 3/11/2026 |
| 4.0.95 | 111 | 3/11/2026 |
| 4.0.94 | 111 | 3/11/2026 |
| 4.0.93 | 98 | 3/10/2026 |
| 4.0.92 | 110 | 3/10/2026 |
| 4.0.91 | 102 | 3/10/2026 |
| 4.0.90 | 103 | 3/10/2026 |
| 4.0.89 | 105 | 3/10/2026 |
Update dependency Soenneker.Extensions.ValueTask to 4.0.110 (#92)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>