@hackage shared-resource-cache0.1.0.3

A thread-safe cache for sharing resources across threads with automatic expiry

shared-resource-cache

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 TChan broadcast channel. Using resourcet, 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.