cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.38.0.
--
-- see: https://github.com/sol/hpack
name: shared-resource-cache
version: 0.2.0.3
synopsis: A thread-safe cache for sharing resources across threads with automatic expiry
description: 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](https://hackage.haskell.org/package/stm-2.5.3.1/docs/Control-Concurrent-STM-TChan.html).
Using [resourcet](https://hackage.haskell.org/package/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.
category: Concurrency
homepage: https://github.com/happy0/shared-resource-cache#readme
bug-reports: https://github.com/happy0/shared-resource-cache/issues
author: Gordon Martin
maintainer: gordonhughmartin@gmail.com
copyright: 2026 Gordon Martin
license: MIT
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
CHANGELOG.md
source-repository head
type: git
location: https://github.com/happy0/shared-resource-cache
library
exposed-modules:
Data.SharedResourceCache
other-modules:
Data.SharedResourceCache.Internal.CacheItem
Data.SharedResourceCache.Internal.Broom
Data.SharedResourceCache.Internal.ExpiringSharedResourceCache
Data.SharedResourceCache.Internal.Model
hs-source-dirs:
src
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
build-depends:
base >=4.7 && <5
, focus ==1.0.*
, hashable >=1.3 && <2
, list-t ==1.0.*
, resourcet ==1.3.*
, stm >=2.4 && <2.6
, stm-containers >=1.2 && <2
, text >=2.0 && <2.2
, time >=1.12 && <2
default-language: Haskell2010
test-suite shared-resource-cache-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Paths_shared_resource_cache
hs-source-dirs:
test
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
, focus ==1.0.*
, hashable >=1.3 && <2
, list-t ==1.0.*
, resourcet ==1.3.*
, shared-resource-cache
, stm >=2.4 && <2.6
, stm-containers >=1.2 && <2
, text >=2.0 && <2.2
, time >=1.12 && <2
default-language: Haskell2010