Soenneker.Utils.ConcurrentCircularQueue 4.0.129

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Utils.ConcurrentCircularQueue --version 4.0.129
                    
NuGet\Install-Package Soenneker.Utils.ConcurrentCircularQueue -Version 4.0.129
                    
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.129" />
                    
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.129" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.ConcurrentCircularQueue" />
                    
Project file
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.129
                    
#r "nuget: Soenneker.Utils.ConcurrentCircularQueue, 4.0.129"
                    
#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.129
                    
#: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.129
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=4.0.129
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image 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 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.

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.135 57 7/29/2026
4.0.134 95 7/28/2026
4.0.133 84 7/28/2026
4.0.132 86 7/28/2026
4.0.131 94 7/27/2026
4.0.130 151 7/19/2026
4.0.129 100 7/18/2026
4.0.128 130 7/17/2026
4.0.127 119 7/16/2026
4.0.126 99 7/16/2026
4.0.125 91 7/16/2026
4.0.124 484 6/19/2026
4.0.123 108 6/19/2026
4.0.122 115 6/19/2026
4.0.121 108 6/18/2026
4.0.119 128 6/16/2026
4.0.118 337 6/6/2026
4.0.117 116 6/6/2026
4.0.116 113 6/5/2026
4.0.115 109 6/5/2026
Loading failed

Update dependency Soenneker.Asyncs.Locks to 4.0.61 (#155)