Search by

hydrakit / cache

whleucka

A small key/value store behind one contract, with the atomic counters rate limiting needs.

Package info

github.com/hydra-foundation/cache

pkg:composer/hydrakit/cache

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

dev-main / 0.3.x-dev 2026-09-11 20:46 UTC

This package is not auto-updated.

Last update: 2026-09-12 10:13:46 UTC


README

Read-only mirror. hydrakit/cache is developed in hydra-foundation/hydra under packages/cache, and republished here on every push. A commit pushed to this repository is overwritten by the next one; issues are disabled for that reason, and a pull request opened here cannot be merged. Both belong upstream.

A key/value store with expiry behind one contract, in two implementations: Redis, shared by every process that connects to it, and an in-memory array for tests and single-process tooling. The counter methods are why the contract is narrow — increment() adds to a key and opens its expiry window on the first hit, as one atomic step, and never re-arms that window afterwards. Anything budgeting per client therefore counts against a window measured from the first request rather than one a steady stream can hold open indefinitely. ArrayStore is deliberately not a fallback for an unreachable Redis: it is per-process, so behind a worker pool it would give each worker its own counters and multiply every limit by the pool size.