{"id":19493319,"url":"https://github.com/negrel/ringo","last_synced_at":"2026-06-15T19:31:36.574Z","repository":{"id":57519055,"uuid":"248612573","full_name":"negrel/ringo","owner":"negrel","description":" :atom_symbol: A thread safe, lock free, efficient ring buffer library.","archived":false,"fork":false,"pushed_at":"2024-06-04T07:15:55.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-14T15:03:25.053Z","etag":null,"topics":["buffer","circular","circular-buffer","go","golang","ring"],"latest_commit_sha":null,"homepage":"","language":"Go","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/negrel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-19T21:54:49.000Z","updated_at":"2024-10-24T14:02:08.000Z","dependencies_parsed_at":"2024-03-19T04:41:23.330Z","dependency_job_id":"59954e2e-6820-432b-b266-011e6ce1125e","html_url":"https://github.com/negrel/ringo","commit_stats":null,"previous_names":["negrel/atomic-ring"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/negrel/ringo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fringo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fringo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fringo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fringo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/negrel","download_url":"https://codeload.github.com/negrel/ringo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/negrel%2Fringo/sbom","scorecard":{"id":678694,"data":{"date":"2025-08-11","repo":{"name":"github.com/negrel/ringo","commit":"e14da10dd445be209831f8452c4ec98fd6e6c5b6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T22:24:02.253Z","repository_id":57519055,"created_at":"2025-08-21T22:24:02.253Z","updated_at":"2025-08-21T22:24:02.253Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34377872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"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","circular-buffer","go","golang","ring"],"created_at":"2024-11-10T21:25:16.751Z","updated_at":"2026-06-15T19:31:36.555Z","avatar_url":"https://github.com/negrel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cimg height=\"250\" src=\"https://raw.githubusercontent.com/negrel/ringo/master/.github/atom.svg\"\u003e\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://pkg.go.dev/github.com/negrel/ringo\"\u003e\n\t\t\u003cimg src=\"https://godoc.org/github.com/negrel/ringo?status.svg\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://goreportcard.com/badge/github.com/negrel/ringo\"\u003e\n\t\t\u003cimg src=\"https://goreportcard.com/badge/github.com/negrel/ringo\"\u003e\n\t\u003c/a\u003e\n\t\u003ca href=\"https://github.com/negrel/ringo/raw/master/LICENSE\"\u003e\n\t\t\u003cimg src=\"https://img.shields.io/badge/license-MIT-green\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e\n\n# :atom_symbol: Ringo - Fast, lock free ring buffers.\n\nA thread safe, lock free, efficient ring buffer library.\n\nRingo is heavily inspired by [go-diodes](https://github.com/cloudfoundry/go-diodes/) \nbut aims to provide a more safe (no unsafe) alternative.\n\n## Features\n\n- :zap: [**Efficient**](https://github.com/negrel/ringo#zap-benchmarks)\n- **Thread-safe** : manipulated via [atomics](https://pkg.go.dev/sync/atomic) operations.\n- **Type-safe** : buffers are implemented using [Go 1.18 generics](https://go.dev/doc/tutorial/generics).\n\n## Getting started\n\n### Installation\n\nUsing **go get** :\n\n```bash\ngo get github.com/negrel/ringo.git\n```\n\nUsing **go modules** :\n\n```go\npackage \"your_package_name\"\n\nimport (\n\t\"github.com/negrel/ringo\"\n)\n\nfunc main() {\n    // Your code here\n}\n```\n\nthen\n\n```bash\ngo mod tidy\n```\n\n### Example: Basic Use\n\n```go\nbuffer := ringo.NewManyToOne[int](1024)\n\ngo func() {\n    for i := 0; i \u003c math.MaxInt; i++ {\n        buffer.Push(i)\n    }\n}()\n\nctx, cancel := context.WithCancel(context.Background())\ngo func() {\n    time.Sleep(time.Minute)\n    cancel()\n}()\n\npoller := ringo.NewPoller(buffer, ringo.WithPollingContext[int](ctx))\nfor {\n    next, done, dropped := poller.Next()\n    // Writer is faster than reader, some data was overwritten.\n    if dropped \u003e 0 {\n        log.Printf(\"lost %v int\", dropped)\n    }\n    // Context canceled.\n    if done {\n        break\n    }\n    log.Print(next)\n}\n```\n\n## Storage Layer\n\n### OneToOne\n\nOneToOne ring buffer isn't implemented as my private implementation didn't\nprovide any performance gain. Use ManyToOne.\n\n### ManyToOne\n\nThe ManyToOne ring buffer is optimized for many producing (invoking Push())\ngo-routines and a single consuming (invoking TryNext()) go-routine. It is not\nthread safe for multiple readers.\n\n## Access Layer\n\n### Poller\n\nThe Poller uses polling via time.Sleep(...) when Next() is invoked. While\npolling might seem sub-optimal, it allows the producer to be completely\ndecoupled from the consumer. If you require very minimal push back on the\nproducer, then the Poller is a better choice. However, if you require several\nring buffers (e.g. one per connected client), then having several go-routines polling\n(sleeping) may be hard on the scheduler.\n\n### Waiter\n\nThe Waiter uses a conditional mutex to manage when the reader is alerted of new\ndata. While this method is great for the scheduler, it does have extra overhead\nfor the producer. Therefore, it is better suited for situations where you have\nseveral ring buffers and can afford slightly slower producers.\n\n## :zap: Benchmarks\n\n```\ngoos: linux\ngoarch: amd64\npkg: github.com/negrel/ringo\ncpu: AMD Ryzen 7 7840U w/ Radeon  780M Graphics     \nBenchmarkRing\nBenchmarkRing-16                206156005                6.042 ns/op          16 B/op          0 allocs/op\nBenchmarkManyToOne\nBenchmarkManyToOne-16           40134350                30.07 ns/op           16 B/op          1 allocs/op\nBenchmarkManyToOneWaiter\nBenchmarkManyToOneWaiter-16     33045910                33.27 ns/op           16 B/op          1 allocs/op\nBenchmarkManyToOnePoller\nBenchmarkManyToOnePoller-16     34575518                34.47 ns/op           16 B/op          1 allocs/op\nPASS\nok      github.com/negrel/ringo 7.718s\n```\n\n## Known issues\n\nIf a ring buffer was to be written to 18446744073709551615+1 times it would overflow\na uint64. This will cause problems if the size of the ring buffer is not a power of\ntwo (2^x). If you write into a ring buffer at the rate of one message every\nnanosecond, without restarting your process, it would take you 584.54 years to\nencounter this issue.\n\n## :stars: Show your support\n\nPlease give a :star: if this project helped you!\n\n## Acknowledgments\n\n\u003ca href=\"https://iconscout.com/icons/atomic\" target=\"_blank\"\u003eAtomic Icon\u003c/a\u003e by \u003ca href=\"https://iconscout.com/contributors/oviyan\"\u003eVignesh Oviyan\u003c/a\u003e on \u003ca href=\"https://iconscout.com\"\u003eIconscout\u003c/a\u003e\n\n## :scroll: License\n\nMIT © Alexandre Negrel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegrel%2Fringo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnegrel%2Fringo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnegrel%2Fringo/lists"}