Skip to main content

xlru 0.1.3 copy "xlru: ^0.1.3" to clipboard
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 homepage and repository now point to the package directory on the main branch.

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) and XlruAsyncStore (async) interfaces, the in-memory XlruMemoryStore, and XlruStoreAsAsync.asAsync() to use a sync store as an async one.
  • XlruCache accepts an optional store. Without one it behaves and performs as before.
  • Add XlruAsyncCache for async stores: per-key ordering, putIfAbsent with concurrent-load deduplication, onError for store failures, and XlruAsyncRemovalListener with a lazy loadValue.
  • Add XlruStoreOperation and XlruStoreErrorListener.

0.1.0 #

  • Introduce a zero-dependency LRU cache (XlruCache, XlruRemovalCause, XlruRemovalListener). XlruCache is a final 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/putIfAbsent from that call's eviction; opt into pure LRU order with allowSelfEviction: true.
  • Add usePinned, a scoped pin that always unpins.
  • Reserve XlruRemovalCause.lost for storage-backed caches, so adding backends later does not break exhaustive switches.
  • Skip removal bookkeeping when no onRemove listener 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.
1
likes
160
points
462
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A zero-dependency LRU cache with reason-aware removal callbacks, reference-counted pinning, and non-promoting lookups.

Repository (GitHub)
View/report issues

Topics

#cache #lru #data-structures #collections #eviction

License

MIT (license)

More

Packages that depend on xlru