{"id":24271868,"url":"https://github.com/soenneker/soenneker.utils.concurrentcircularqueue","last_synced_at":"2026-03-10T06:01:17.600Z","repository":{"id":225570785,"uuid":"766319861","full_name":"soenneker/soenneker.utils.concurrentcircularqueue","owner":"soenneker","description":"A thread-safe collection type for a fixed length of elements, overwriting the oldest element","archived":false,"fork":false,"pushed_at":"2026-01-15T20:02:41.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-16T09:58:20.918Z","etag":null,"topics":["buffer","circular","collection","concurrent","concurrentcircularqueue","csharp","dotnet","queue","thread-safe","util","utils"],"latest_commit_sha":null,"homepage":"https://soenneker.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soenneker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"soenneker","buy_me_a_coffee":"soenneker","thanks_dev":"soenneker","ko_fi":"soenneker","patreon":"soenneker"}},"created_at":"2024-03-02T23:35:56.000Z","updated_at":"2026-01-15T20:02:46.000Z","dependencies_parsed_at":"2025-10-29T22:29:18.863Z","dependency_job_id":null,"html_url":"https://github.com/soenneker/soenneker.utils.concurrentcircularqueue","commit_stats":null,"previous_names":["soenneker/soenneker.utils.concurrentcircularqueue"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/soenneker/soenneker.utils.concurrentcircularqueue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.concurrentcircularqueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.concurrentcircularqueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.concurrentcircularqueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.concurrentcircularqueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soenneker","download_url":"https://codeload.github.com/soenneker/soenneker.utils.concurrentcircularqueue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soenneker%2Fsoenneker.utils.concurrentcircularqueue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29107301,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T00:52:08.035Z","status":"online","status_checked_at":"2026-02-05T02:00:07.839Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buffer","circular","collection","concurrent","concurrentcircularqueue","csharp","dotnet","queue","thread-safe","util","utils"],"created_at":"2025-01-15T17:59:51.272Z","updated_at":"2026-03-10T06:01:17.585Z","avatar_url":"https://github.com/soenneker.png","language":"C#","funding_links":["https://github.com/sponsors/soenneker","https://buymeacoffee.com/soenneker","https://thanks.dev/soenneker","https://ko-fi.com/soenneker","https://patreon.com/soenneker"],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/nuget/v/soenneker.utils.concurrentcircularqueue.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.utils.concurrentcircularqueue/)\n[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.utils.concurrentcircularqueue/publish-package.yml?style=for-the-badge)](https://github.com/soenneker/soenneker.utils.concurrentcircularqueue/actions/workflows/publish-package.yml)\n[![](https://img.shields.io/nuget/dt/soenneker.utils.concurrentcircularqueue.svg?style=for-the-badge)](https://www.nuget.org/packages/soenneker.utils.concurrentcircularqueue/)\n[![](https://img.shields.io/github/actions/workflow/status/soenneker/soenneker.utils.concurrentcircularqueue/codeql.yml?label=CodeQL\u0026style=for-the-badge)](https://github.com/soenneker/soenneker.utils.concurrentcircularqueue/actions/workflows/codeql.yml)\n\n# ![](https://user-images.githubusercontent.com/4441470/224455560-91ed3ee7-f510-4041-a8d2-3fc093025112.png) Soenneker.Utils.ConcurrentCircularQueue\n### A thread-safe collection type for a fixed length of elements, overwriting the oldest element\n\n## Installation\n\n```\ndotnet add package Soenneker.Utils.ConcurrentCircularQueue\n```\n\n## Usage\n\n### Creating an Instance\nInstantiate a `ConcurrentCircularQueue\u003cT\u003e` object by specifying the maximum size of the queue. Optionally, asynchronous locking is available for perfect `.Contains().`\n```csharp\n// Creates a queue with a maximum size of 3.\nvar myQueue = new ConcurrentCircularQueue\u003cint\u003e(3, locking: false);\n```\n\n### Enqueueing Items\nAdd an item to the queue. If the queue has reached its maximum size, the oldest item will be removed.\n```csharp\nawait myQueue.Enqueue(1);\nawait myQueue.Enqueue(2);\nawait myQueue.Enqueue(3);\nawait myQueue.Enqueue(4);\n\n// The queue now contains 2, 3, and 4.\n```\n\n### Dequeueing Items\nRemove and return the oldest item from the queue.\n```csharp\n(bool success, int result) = await myQueue.TryDequeue();\n```\n\n### Checking If an Item Exists\nDetermine if a specific item is in the queue.\n```csharp\nbool exists = await myQueue.Contains(item);\n```\n\n### Count\nRetrieve the current number of items in the queue.\n```csharp\nint currentCount = await myQueue.Count();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoenneker%2Fsoenneker.utils.concurrentcircularqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoenneker%2Fsoenneker.utils.concurrentcircularqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoenneker%2Fsoenneker.utils.concurrentcircularqueue/lists"}