xlru 0.1.3
xlru: ^0.1.3 copied to clipboard
A zero-dependency LRU cache with reason-aware removal callbacks, reference-counted pinning, and non-promoting lookups.
0.1.3 #
- Docs: pubspec
homepageandrepositorynow point to the package directory on themainbranch.
0.1.2 #
- Docs only: rewrote README wording in plain language; Chinese README renamed to README.zh-CN.md.
0.1.1 #
- Add pluggable storage:
XlruStore(sync) andXlruAsyncStore(async) interfaces, the in-memoryXlruMemoryStore, andXlruStoreAsAsync.asAsync()to use a sync store as an async one. XlruCacheaccepts an optionalstore. Without one it behaves and performs as before.- Add
XlruAsyncCachefor async stores: per-key ordering,putIfAbsentwith concurrent-load deduplication,onErrorfor store failures, andXlruAsyncRemovalListenerwith a lazyloadValue. - Add
XlruStoreOperationandXlruStoreErrorListener.
0.1.0 #
- Introduce a zero-dependency LRU cache (
XlruCache,XlruRemovalCause,XlruRemovalListener).XlruCacheis afinal class. - Add reason-aware, reentrant removal callbacks with batch error handling.
- Support reference-counted pins, immediate resizing, and non-promoting lookups.
- Provide ordered, fail-fast iteration and custom key equality.
- Protect the entry written by
set/putIfAbsentfrom that call's eviction; opt into pure LRU order withallowSelfEviction: true. - Add
usePinned, a scoped pin that always unpins. - Reserve
XlruRemovalCause.lostfor storage-backed caches, so adding backends later does not break exhaustiveswitches. - Skip removal bookkeeping when no
onRemovelistener is set. - Store entries in slot arrays behind an open-addressing index: steady-state writes allocate nothing without a listener and hot paths carry no runtime type checks, keeping AOT, dart2js, and dart2wasm builds fast.