Soenneker.Utils.ConcurrentCircularQueue 11.0.214

Prefix Reserved
dotnet add package Soenneker.Utils.ConcurrentCircularQueue --version 11.0.214
                    
NuGet\Install-Package Soenneker.Utils.ConcurrentCircularQueue -Version 11.0.214
                    
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="11.0.214" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.ConcurrentCircularQueue" Version="11.0.214" />
                    
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 11.0.214
                    
#r "nuget: Soenneker.Utils.ConcurrentCircularQueue, 11.0.214"
                    
#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@11.0.214
                    
#: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=11.0.214
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.ConcurrentCircularQueue&version=11.0.214
                    
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

Soenneker.Utils.ConcurrentCircularQueue

A thread-safe, fixed-capacity FIFO queue that discards the oldest item when a new item exceeds its capacity.

Installation

dotnet add package Soenneker.Utils.ConcurrentCircularQueue

Usage

var recentIds = new ConcurrentCircularQueue<int>(maxSize: 3);

await recentIds.Enqueue(10);
await recentIds.Enqueue(20);
await recentIds.Enqueue(30);
await recentIds.Enqueue(40); // 10 is discarded

(bool success, int? oldest) = await recentIds.TryDequeue(); // 20
int count = await recentIds.Count();                         // 2
bool contains = await recentIds.Contains(40);                // true

TryDequeue() returns immediately with success == false when the queue is empty. This is a collection, not a producer/consumer channel: it has no operation that waits for a future item.

Concurrency modes

The default mode uses ConcurrentQueue<T> and atomic counting. Operations are thread-safe, but Contains() and Count() are observations made while other callers may be changing the queue.

var queue = new ConcurrentCircularQueue<Job>(100, locking: true);

With locking: true, enqueue, dequeue, count, and contains operations are serialized through an asynchronous lock. This provides a consistent point-in-time observation relative to the other queue operations, at the cost of contention and asynchronous lock overhead.

Neither mode makes a multi-call sequence atomic. For example, another caller can change the queue between Contains() and TryDequeue().

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
11.0.214 98 12/2/2026
11.0.213 51 12/2/2026
11.0.212 93 12/2/2026
11.0.211 101 12/1/2026
11.0.210 93 12/1/2026
11.0.209 100 11/30/2026
11.0.208 88 11/30/2026
11.0.207 111 11/29/2026
11.0.206 95 11/29/2026
11.0.205 210 11/18/2026
11.0.204 99 11/18/2026
11.0.203 193 11/11/2026
11.0.202 90 11/11/2026
11.0.201 93 11/11/2026
11.0.200 108 11/11/2026
11.0.199 95 11/11/2026
11.0.198 280 11/2/2026
11.0.197 149 10/27/2026
11.0.196 109 10/26/2026
11.0.195 99 10/26/2026
Loading failed

Updated Multiple NuGet packages