{"id":25205117,"url":"https://github.com/0x484558/fairqueue","last_synced_at":"2026-02-21T04:03:24.421Z","repository":{"id":268982925,"uuid":"906065855","full_name":"0x484558/FairQueue","owner":"0x484558","description":"Spatially distancing fair queue","archived":false,"fork":false,"pushed_at":"2026-01-10T12:00:04.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-14T01:09:03.075Z","etag":null,"topics":["data-structures","fairness","no-std","queue","round-robin","stack"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/fairqueue","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0x484558.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-12-20T05:05:34.000Z","updated_at":"2026-01-10T12:00:05.000Z","dependencies_parsed_at":"2024-12-20T17:50:24.120Z","dependency_job_id":null,"html_url":"https://github.com/0x484558/FairQueue","commit_stats":null,"previous_names":["0x484558/spacedqueue","0x484558/fairqueue"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/0x484558/FairQueue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x484558%2FFairQueue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x484558%2FFairQueue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x484558%2FFairQueue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x484558%2FFairQueue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0x484558","download_url":"https://codeload.github.com/0x484558/FairQueue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0x484558%2FFairQueue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29672772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T03:11:15.450Z","status":"ssl_error","status_checked_at":"2026-02-21T03:10:34.920Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["data-structures","fairness","no-std","queue","round-robin","stack"],"created_at":"2025-02-10T09:18:54.519Z","updated_at":"2026-02-21T04:03:19.399Z","avatar_url":"https://github.com/0x484558.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FairQueue\n\nFairQueue is a Rust `no_std` (`alloc`) library that implements a fair queue through spatial distancing of similar values. The data structure presented in `fairqueue` crate ensures that groups of items are equitably interleaved with items from other groups and can be scheduled in a round-robin manner.\n\n## Usage\n\n```Rust\nuse fairqueue::{FairQueue, FairGroup};\n\n#[derive(Debug, PartialEq)]\nstruct Event {\n    timestamp: u32,\n    user_id: \u0026'static str,\n}\n\nimpl FairGroup for Event {\n    fn is_same_group(\u0026self, other: \u0026Self) -\u003e bool {\n        self.user_id == other.user_id\n    }\n}\n\nfn main() {\n    let mut queue = FairQueue::new();\n\n    queue.insert(\u0026Event { timestamp: 1, user_id: \"user1\" });\n    queue.insert(\u0026Event { timestamp: 2, user_id: \"user2\" });\n    queue.insert(\u0026Event { timestamp: 3, user_id: \"user1\" });\n\n    assert_eq!(queue.pop(), Some(\u0026Event { timestamp: 1, user_id: \"user1\" }));\n    assert_eq!(queue.pop(), Some(\u0026Event { timestamp: 2, user_id: \"user2\" }));\n    assert_eq!(queue.pop(), Some(\u0026Event { timestamp: 3, user_id: \"user1\" }));\n    assert_eq!(queue.pop(), None);\n}\n```\n\n## API Overview\n\n### `FairQueue`\n\n- `new() -\u003e FairQueue` - Constructs a new, empty instance of the queue.\n\n- `insert(\u0026mut self, value: \u0026V: FairGroup)` - Adds a value to the queue, distancing it from values within the same group.\n\n- `pop(\u0026mut self) -\u003e Option\u003c\u0026V\u003e` - Removes and returns the next item in the queue, adhering to round-robin scheduling.\n\n- `peek(\u0026self) -\u003e Option\u003c\u0026\u0026V\u003e` - Returns a reference to the next item in the queue without removing it.\n\n## License\n\nFairQueue is distributed under the [BSD Zero Clause License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x484558%2Ffairqueue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0x484558%2Ffairqueue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x484558%2Ffairqueue/lists"}