ruby-concurrency / ruby-concurrency/concurrent-ruby

Implement FIFO and LRU caches through a Map memory limit

Open
#1,095 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
5.8k
Forks
420
Avg merge
20h 45m
Merged PRs (30d)
4

Description

I would like to allow a max_bytesize to be set for a Concurrent::Map, which would stop the combination of the map and its entries from getting any bigger by automatically deleting entries when a new one is added. Deletion of the oldest entry is easy through Hash#shift. New entries would automatically make a FIFO cache, while an LRU cache would need each accessed entry to be deleted and re-added.

Is this something worth working up a PR for? If so, does anyone have any suggestions on what to do and what not to do?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Concurrent::Map entry point and review the issue discussion for a decision on scope. Clarify whether max_bytesize should support FIFO, LRU, or both, and define how size and access behavior are measured before implementation; the issue does not yet specify complete done criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.