Soenneker.Extensions.ConcurrentQueues.Strings
4.0.22
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Extensions.ConcurrentQueues.Strings --version 4.0.22
NuGet\Install-Package Soenneker.Extensions.ConcurrentQueues.Strings -Version 4.0.22
<PackageReference Include="Soenneker.Extensions.ConcurrentQueues.Strings" Version="4.0.22" />
<PackageVersion Include="Soenneker.Extensions.ConcurrentQueues.Strings" Version="4.0.22" />
<PackageReference Include="Soenneker.Extensions.ConcurrentQueues.Strings" />
paket add Soenneker.Extensions.ConcurrentQueues.Strings --version 4.0.22
#r "nuget: Soenneker.Extensions.ConcurrentQueues.Strings, 4.0.22"
#:package Soenneker.Extensions.ConcurrentQueues.Strings@4.0.22
#addin nuget:?package=Soenneker.Extensions.ConcurrentQueues.Strings&version=4.0.22
#tool nuget:?package=Soenneker.Extensions.ConcurrentQueues.Strings&version=4.0.22
Soenneker.Extensions.ConcurrentQueues.Strings
Reads the final string from a ConcurrentQueue<string> enumeration snapshot without copying the queue to an array.
Installation
dotnet add package Soenneker.Extensions.ConcurrentQueues.Strings
Usage
using Soenneker.Extensions.ConcurrentQueues.Strings;
var queue = new ConcurrentQueue<string>();
queue.Enqueue("first");
queue.Enqueue("second");
string? tail = queue.GetTail(); // "second"
GetTail() enumerates a moment-in-time snapshot and returns its last item, or null when the snapshot is empty. It does not dequeue or otherwise mutate the queue.
The operation is O(n), not O(1). It avoids ToArray() and a full array copy, but the framework's snapshot enumerator may allocate and retains access to the observed queue segments for the duration of enumeration.
The result is observational only: another thread can dequeue that item immediately, and enqueues after snapshot creation are not reflected. Do not use it to make a check-then-act decision or to consume work. Use TryPeek() for the head, TryDequeue() for atomic consumption, or maintain separate synchronized state if frequent tail access is a requirement.
Although the queue is annotated for non-null strings, a null can still be inserted by unchecked or legacy code. In that case a null tail is indistinguishable from an empty queue through this API.
| 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. |
-
net10.0
- No dependencies.
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.35 | 85 | 11/18/2026 |
| 11.0.34 | 95 | 11/11/2026 |
| 11.0.33 | 88 | 11/10/2026 |
| 11.0.32 | 109 | 10/27/2026 |
| 11.0.31 | 100 | 10/26/2026 |
| 11.0.30 | 97 | 10/26/2026 |
| 4.0.29 | 105 | 10/14/2026 |
| 4.0.28 | 103 | 10/14/2026 |
| 4.0.23 | 101 | 10/12/2026 |
| 4.0.22 | 107 | 10/12/2026 |
| 4.0.21 | 96 | 10/11/2026 |
| 4.0.20 | 111 | 9/24/2026 |
| 4.0.19 | 117 | 9/15/2026 |
| 4.0.18 | 113 | 9/12/2026 |
| 4.0.17 | 126 | 8/30/2026 |
| 4.0.16 | 131 | 8/29/2026 |
| 4.0.15 | 146 | 7/27/2026 |
| 4.0.14 | 138 | 7/16/2026 |
| 4.0.13 | 147 | 6/18/2026 |
| 4.0.12 | 139 | 6/5/2026 |
Use NuGet Resilient Login v2