{"id":51342440,"url":"https://github.com/vanderhell/microres","last_synced_at":"2026-07-02T09:01:16.228Z","repository":{"id":368783952,"uuid":"1187533679","full_name":"Vanderhell/microres","owner":"Vanderhell","description":"Fault-tolerance primitives for embedded systems in C99: retry backoff, circuit breaker, and rate limiter with zero dependencies and zero allocations.","archived":false,"fork":false,"pushed_at":"2026-07-02T07:33:33.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-02T08:15:47.268Z","etag":null,"topics":["c","c99","circuit-breaker","embedded","fault-tolerance","iot","library","resilence","retry","zero-allocation"],"latest_commit_sha":null,"homepage":"","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/Vanderhell.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"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}},"created_at":"2026-03-20T20:51:32.000Z","updated_at":"2026-07-02T07:33:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Vanderhell/microres","commit_stats":null,"previous_names":["vanderhell/microres"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Vanderhell/microres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vanderhell%2Fmicrores","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vanderhell%2Fmicrores/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vanderhell%2Fmicrores/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vanderhell%2Fmicrores/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vanderhell","download_url":"https://codeload.github.com/Vanderhell/microres/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vanderhell%2Fmicrores/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35040024,"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-07-02T02:00:06.368Z","response_time":173,"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":["c","c99","circuit-breaker","embedded","fault-tolerance","iot","library","resilence","retry","zero-allocation"],"created_at":"2026-07-02T09:00:44.861Z","updated_at":"2026-07-02T09:01:16.201Z","avatar_url":"https://github.com/Vanderhell.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# microres\n\n`microres` is a small C library for three caller-owned resilience primitives:\n\n- synchronous retry with fixed, linear, or exponential backoff\n- a one-probe circuit breaker\n- a discrete token-bucket rate limiter\n\nThe current repository state is an audited contract rewrite. It is not declared release-ready or production-ready in this repo.\n\n## Scope\n\n- C99 library API\n- C11 and C++ consumer builds via CMake\n- caller-owned state only\n- no heap allocation\n- no hidden globals\n- no internal locking\n\n## Non-goals\n\n- async schedulers or coroutine APIs\n- ISR-safe retry or breaker execution\n- persistence or crash recovery\n- implicit thread safety\n\n## Quick start\n\n```c\n#include \"mres.h\"\n\nstatic uint32_t app_clock(void *context) {\n    (void)context;\n    return 0u;\n}\n\nstatic int app_wait(void *context, uint32_t delay_ms) {\n    (void)context;\n    (void)delay_ms;\n    return 0;\n}\n\nstatic int operation(void *context) {\n    (void)context;\n    return 0;\n}\n\nint main(void) {\n    mres_platform_t platform = { NULL, app_clock, app_wait };\n    mres_retry_policy_t retry_policy = { 3u, MRES_BACKOFF_LINEAR, 0u, 0u, 100u, 500u };\n    mres_retry_t retry;\n    int operation_result = 0;\n\n    if (mres_retry_init(\u0026retry, \u0026retry_policy) != MRES_OK) {\n        return 1;\n    }\n\n    if (mres_retry_exec(\u0026retry, operation, NULL, \u0026platform, \u0026operation_result) != MRES_OK) {\n        return 1;\n    }\n\n    return 0;\n}\n```\n\n## Contracts\n\n- Retry is synchronous. A positive computed delay without a wait callback returns `MRES_ERR_WAIT_REQUIRED`.\n- Retry, breaker, and rate limiter each copy policy input during successful initialization.\n- Library status and operation return codes are separated. Callback return values are reported through output parameters.\n- Jitter uses per-instance xorshift state. It is deterministic for equal seeds and is not cryptographic.\n- `uint32_t` clocks are treated as modulo millisecond counters. One full wrap cycle is the supported limit for elapsed-time reasoning.\n- Separate instances are independent. Shared instances require external serialization around the full call, including callbacks.\n- `longjmp` or other nonlocal exits from callbacks are unsupported and may leave an instance busy.\n\n## Build and package support\n\n- CMake target: `microres::microres`\n- Generated public config header: `mres_config.h`\n- Consumer fixtures:\n  - `tests/consumers/add_subdirectory`\n  - `tests/consumers/find_package`\n  - `tests/consumers/cpp11`\n  - `tests/consumers/cpp17`\n  - `tests/consumers/cpp20`\n\n## Documentation\n\n- [API reference](docs/API_REFERENCE.md)\n- [Cookbook](docs/COOKBOOK.md)\n- [Design notes](docs/DESIGN.md)\n- [Porting guide](docs/PORTING_GUIDE.md)\n- [Issues and troubleshooting](docs/ISSUES.md)\n- [Verification status](docs/VERIFICATION.md)\n- [Contributing](CONTRIBUTING.md)\n- [Security](SECURITY.md)\n- [Changelog](CHANGELOG.md)\n\n## Release workflow\n\nReleases are tag-triggered only. The repository workflow is defined in [.github/workflows/release.yml](.github/workflows/release.yml) and operates on pushed `v*` tags.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanderhell%2Fmicrores","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvanderhell%2Fmicrores","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvanderhell%2Fmicrores/lists"}