Soenneker.Utils.ConcurrentCircularQueue
4.0.85
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Soenneker.Utils.ConcurrentCircularQueue --version 4.0.85
NuGet\Install-Package Soenneker.Utils.ConcurrentCircularQueue -Version 4.0.85
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.85" />
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.85" />
<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.85
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Utils.ConcurrentCircularQueue, 4.0.85"
#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.85
#: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.85
#tool nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=4.0.85
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.23)
- Soenneker.Extensions.ValueTask (>= 4.0.105)
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.95 | 0 | 3/11/2026 |
| 4.0.94 | 0 | 3/11/2026 |
| 4.0.93 | 0 | 3/10/2026 |
| 4.0.92 | 0 | 3/10/2026 |
| 4.0.91 | 4 | 3/10/2026 |
| 4.0.90 | 24 | 3/10/2026 |
| 4.0.89 | 26 | 3/10/2026 |
| 4.0.88 | 31 | 3/10/2026 |
| 4.0.87 | 32 | 3/9/2026 |
| 4.0.85 | 35 | 3/9/2026 |
| 4.0.84 | 169 | 3/5/2026 |
| 4.0.83 | 37 | 3/5/2026 |
| 4.0.82 | 38 | 3/5/2026 |
| 4.0.81 | 38 | 3/4/2026 |
| 4.0.80 | 42 | 3/4/2026 |
| 4.0.79 | 108 | 2/5/2026 |
| 4.0.78 | 104 | 1/22/2026 |
| 4.0.77 | 90 | 1/21/2026 |
| 4.0.76 | 90 | 1/20/2026 |
| 4.0.75 | 212 | 1/12/2026 |
Loading failed