async-state-consistency

Solid

Use when designing, reviewing, debugging, or testing asynchronous state holders, caches, observers, subscriber notifications, memoized or coalesced loads, replay, or one-shot reads where invalidation, late subscribers, stale in-flight completion, read or publish races, out-of-order completion, or keyed/global ownership can expose stale state. Not for UI-only loading presentation, deployment topology, distributed consensus, or unrelated test flakiness.

AI & Automation 8 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
32
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Async State Consistency Use for language-neutral component state whose asynchronous work can race with clear, invalidation, expiry, refresh, another publication, or a direct caller. ## Contract First Before proposing a repair: 1. Name the authoritative state holder and every path that can return, publish, replay, or repopulate it: observers, late subscribers, warm cache, one-shot calls, memoization, request coalescing, persistence, and derived projections. 2. Model lifecycle states explicitly. Keep initial or unknown distinct from `Available(empty)`, and define invalidated, error, stale, and retry outcomes only where the contract needs them. 3. Name each ownership domain: global invalidation generation, keyed/domain generation, ordinary publication revision, operation identity, and any dependency revisions. 4. Choose and name the supersession policy for competing work: latest-start-wins or latest-success-wins. Define what happens to older work when a newer attempt fails or is cancelled. 5. Choose a separate same-generation admission policy: join/coalesce one shared operation, queue/serialize distinct attempts, or run independently. 6. For shared work, distinguish cancellation of one waiter from cancellation requested for the shared entry, and define when that entry stops being joinable. 7. Define the direct caller outcome when its work is rejected: authoritative reread, declared stale/retry/cancellation, or another explicit result. 8....

Details

Author
Xopoko
Repository
Xopoko/plug-n-skills
Created
1 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category