shared-resource-cache: A thread-safe cache for sharing resources across threads with automatic expiry
A cache designed for guaranteeing that different threads can share the same reference to a resource. For example, it allows threads to communicate via a shared
.
Using
, items are only removed from the cache after no
sharers are holding the
resource and the item has expired (according to the expiry configuration the cache was constructed with.)
Note: an MVar is used to coordinate between threads that only one thread does the initial load of the resource with the given IO action if multiple threads try and retrieve a resource that is not yet cached at the same time.
[Skip to Readme]
Downloads
- shared-resource-cache-0.1.0.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | base (>=4.7 && <5), list-t (>=1.0 && <1.1), resourcet (>=1.3 && <1.4), stm (>=2.4 && <2.6), stm-containers (>=1.2 && <2), text (>=2.0 && <2.2), time (>=1.12 && <2) [details] |
| License | MIT |
| Copyright | 2026 Gordon Martin |
| Author | Gordon Martin |
| Maintainer | gordonhughmartin@gmail.com |
| Uploaded | by happy0 at 2026-03-22T23:17:32Z |
| Category | Concurrency |
| Home page | https://github.com/happy0/shared-resource-cache#readme |
| Bug tracker | https://github.com/happy0/shared-resource-cache/issues |
| Source repo | head: git clone https://github.com/happy0/shared-resource-cache |
| Downloads | 2 total (2 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2026-03-22 [all 1 reports] |