Soenneker.Utils.ConcurrentCircularQueue
4.0.109
Prefix Reserved
dotnet add package Soenneker.Utils.ConcurrentCircularQueue --version 4.0.109
NuGet\Install-Package Soenneker.Utils.ConcurrentCircularQueue -Version 4.0.109
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="Soenneker.Utils.ConcurrentCircularQueue" Version="4.0.109" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.ConcurrentCircularQueue" Version="4.0.109" />
<PackageReference Include="Soenneker.Utils.ConcurrentCircularQueue" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Utils.ConcurrentCircularQueue --version 4.0.109
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Utils.ConcurrentCircularQueue, 4.0.109"
#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.
#:package Soenneker.Utils.ConcurrentCircularQueue@4.0.109
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=4.0.109
#tool nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=4.0.109
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Soenneker.Asyncs.Locks (>= 4.0.41)
- Soenneker.Extensions.ValueTask (>= 4.0.113)
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.109 | 104 | 3/13/2026 |
| 4.0.108 | 87 | 3/13/2026 |
| 4.0.107 | 83 | 3/13/2026 |
| 4.0.106 | 84 | 3/12/2026 |
| 4.0.105 | 89 | 3/12/2026 |
| 4.0.100 | 90 | 3/12/2026 |
| 4.0.99 | 84 | 3/12/2026 |
| 4.0.98 | 87 | 3/12/2026 |
| 4.0.96 | 87 | 3/11/2026 |
| 4.0.95 | 91 | 3/11/2026 |
| 4.0.94 | 93 | 3/11/2026 |
| 4.0.93 | 82 | 3/10/2026 |
| 4.0.92 | 93 | 3/10/2026 |
| 4.0.91 | 85 | 3/10/2026 |
| 4.0.90 | 88 | 3/10/2026 |
| 4.0.89 | 87 | 3/10/2026 |
| 4.0.88 | 91 | 3/10/2026 |
| 4.0.87 | 84 | 3/9/2026 |
| 4.0.85 | 85 | 3/9/2026 |
| 4.0.84 | 288 | 3/5/2026 |
Loading failed
Update dependency Soenneker.Asyncs.Locks to 4.0.41 (#99)