{"id":15099854,"url":"https://github.com/flowerinthenight/zbackoff","last_synced_at":"2025-10-24T01:10:37.287Z","repository":{"id":249935221,"uuid":"833000885","full_name":"flowerinthenight/zbackoff","owner":"flowerinthenight","description":"Jittered backoff implementation in Zig.","archived":false,"fork":false,"pushed_at":"2025-03-18T18:00:57.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T02:35:57.406Z","etag":null,"topics":["backoff","jitter","retry","zig","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/flowerinthenight.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":"2024-07-24T06:55:11.000Z","updated_at":"2025-03-18T17:59:47.000Z","dependencies_parsed_at":"2024-08-09T07:43:03.620Z","dependency_job_id":"58f975f8-4043-4315-b32f-9fa1a9b57464","html_url":"https://github.com/flowerinthenight/zbackoff","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"809bb5bf609d7d2ae68128e3529a53d04aa41137"},"previous_names":["flowerinthenight/zbackoff"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/flowerinthenight/zbackoff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fzbackoff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fzbackoff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fzbackoff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fzbackoff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowerinthenight","download_url":"https://codeload.github.com/flowerinthenight/zbackoff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowerinthenight%2Fzbackoff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265482238,"owners_count":23774017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["backoff","jitter","retry","zig","ziglang"],"created_at":"2024-09-25T17:28:19.399Z","updated_at":"2025-10-24T01:10:32.216Z","avatar_url":"https://github.com/flowerinthenight.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Main](https://github.com/flowerinthenight/zbackoff/actions/workflows/main.yml/badge.svg)](https://github.com/flowerinthenight/zbackoff/actions/workflows/main.yml)\n\n(This repo is mirrored to [https://codeberg.org/flowerinthenight/zbackoff](https://codeberg.org/flowerinthenight/zbackoff)).\n\n**zbackoff** implements jittered backoff. Useful when retrying operations that can potentially fail (i.e. network calls). The implementation is based on [this article](https://www.awsarchitectureblog.com/2015/03/backoff.html) from the AWS Architecture Blog.\n\nYou can use it like so:\n\n``` zig\nconst std = @import(\"std\");\nconst zbackoff = @import(\"zbackoff\");\n\nfn funcThatCanFail() !u64 {\n    _ = try std.time.Instant.now();\n    std.debug.print(\"funcThatFails()\\n\", .{});\n    return error.UnwantedResult1;\n}\n\npub fn main() void {\n    var bo = zbackoff.Backoff{};\n    for (0..3) |_| {\n        const result = funcThatCanFail() catch {\n            std.time.sleep(bo.pause());\n            continue;\n        };\n        _ = result;\n        break;\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowerinthenight%2Fzbackoff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowerinthenight%2Fzbackoff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowerinthenight%2Fzbackoff/lists"}