Skip to content

Extract Directive ADT into cache-adt module; harden internals#346

Merged
stasimus merged 3 commits intomasterfrom
stas/extract-adt
Apr 24, 2026
Merged

Extract Directive ADT into cache-adt module; harden internals#346
stasimus merged 3 commits intomasterfrom
stas/extract-adt

Conversation

@stasimus
Copy link
Copy Markdown
Contributor

  • Extract Directive sealed trait into standalone cache-adt module, allowing downstream consumers to depend on the ADT alone without pulling in scache and its cats-effect transitive dependencies. This
    prepares the ground for alternative cache backend implementations (e.g. Caffeine-based) that need to share the Directive type without depending on the full scache module.
    • Fix Partitions hash distribution: use bitwise AND instead of math.abs to correctly handle Int.MinValue
    • Add CAS retry bounds (10k) to outer LoadingCache loops as a safety net against infinite spinning under extreme contention
    • Replace silent release error swallowing (.handleError(ignore)) with stderr logging
    • Add minimum 10ms cooldown floor in ExpiringCache for short TTLs
    • Expand PartitionsSpec with Int.MinValue, negative hash, and distribution quality tests

sshevchenko and others added 3 commits April 24, 2026 17:37
- Extract Directive sealed trait into standalone cache-adt module,
  allowing downstream consumers to depend on the ADT alone without
  pulling in scache and its cats-effect transitive dependencies
- Fix Partitions hash distribution: use bitwise AND instead of
  math.abs to handle Int.MinValue correctly
- Add CAS retry bounds (10k) to outer LoadingCache loops as a
  safety net against infinite spinning under extreme contention
- Replace silent release error swallowing with stderr logging
- Add minimum 10ms cooldown floor in ExpiringCache for short TTLs
- Expand PartitionsSpec with Int.MinValue, negative hash, and
  distribution quality tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stasimus stasimus merged commit ae320bf into master Apr 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant