Skip to content

Extract the per-link lock-out and a JSON-file record store (second host: heed) #3

Closed

Description

@thorwhalen

Two hosts now carry the same code: thorwhalen/annals share_api and i2mint/heed#90 heed/review_access.py.

  1. Per-link lock-out: two limiters (per client per link; per link from everyone, locking for a window) plus a locked dict. Candidate: caplinks.AttemptGuard(rate_limiter, link_failure_limiter, lock_s, clock) with allow(link, client) -> bool and failed(link). Reviewer notes: prune the dict, and note it is per process even with a shared limiter.
  2. JSON-file record store (MutableMapping: atomic write via mkstemp so 0600, checked keys, tolerant listing): annals' _ShareRecords and heed's _JsonRecords are the same job.

Relates to i2mint/heed#88.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions