Soenneker.Utils.ConcurrentCircularQueue
4.0.124
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.124
NuGet\Install-Package Soenneker.Utils.ConcurrentCircularQueue -Version 4.0.124
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.124" />
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.124" />
<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.124
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Utils.ConcurrentCircularQueue, 4.0.124"
#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.124
#: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.124
#tool nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=4.0.124
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.57)
- Soenneker.Extensions.ValueTask (>= 4.0.116)
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.134 | 0 | 7/28/2026 |
| 4.0.133 | 35 | 7/28/2026 |
| 4.0.132 | 40 | 7/28/2026 |
| 4.0.131 | 49 | 7/27/2026 |
| 4.0.130 | 147 | 7/19/2026 |
| 4.0.129 | 97 | 7/18/2026 |
| 4.0.128 | 128 | 7/17/2026 |
| 4.0.127 | 116 | 7/16/2026 |
| 4.0.126 | 96 | 7/16/2026 |
| 4.0.125 | 89 | 7/16/2026 |
| 4.0.124 | 482 | 6/19/2026 |
| 4.0.123 | 106 | 6/19/2026 |
| 4.0.122 | 112 | 6/19/2026 |
| 4.0.121 | 106 | 6/18/2026 |
| 4.0.119 | 126 | 6/16/2026 |
| 4.0.118 | 335 | 6/6/2026 |
| 4.0.117 | 114 | 6/6/2026 |
| 4.0.116 | 111 | 6/5/2026 |
| 4.0.115 | 107 | 6/5/2026 |
| 4.0.113 | 593 | 4/23/2026 |
Loading failed
Update dependency Soenneker.Asyncs.Locks to 4.0.57 (#142)