Skip to content

Commit

Permalink
Merge pull request #2 from mgnsk/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
mgnsk authored Feb 9, 2021
2 parents c8d7ae0 + 94c6c9d commit c2944d1
Show file tree
Hide file tree
Showing 8 changed files with 371 additions and 522 deletions.
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,4 @@ This library is a work in progress.

## How it works

The cache is a wrapper for `sync.Map` which means that all its concurrency guarantees apply.
It additionally supports autoexpiry and capacity limit.

If the capacity is exceeded, the cache will begin evicting least frequently used records.
It takes at least 1 turnover of the full capacity to reach 100% sortedness of the evicted keys.

The cache does not prevent capacity from being exceeded - the maximum overflow
is the number of concurrent writers at any given moment.

To limit maximum overflow one must limit concurrency externally (for example with a channel semaphore).
The cache is a wrapper for `sync.Map` with autoexpiry, capacity limit and near-LFU eviction.
Loading

0 comments on commit c2944d1

Please sign in to comment.