https://github.com/fuuzetsu/concurrent-resource-map
Concurrent resource map
https://github.com/fuuzetsu/concurrent-resource-map
concurrent-data-structure haskell
Last synced: 5 months ago
JSON representation
Concurrent resource map
- Host: GitHub
- URL: https://github.com/fuuzetsu/concurrent-resource-map
- Owner: Fuuzetsu
- License: bsd-3-clause
- Created: 2020-03-09T05:56:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-28T07:10:34.000Z (about 4 years ago)
- Last Synced: 2025-09-13T00:04:28.170Z (6 months ago)
- Topics: concurrent-data-structure, haskell
- Language: Haskell
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# concurrent-resource-map [](https://travis-ci.com/Fuuzetsu/concurrent-resource-map)
User-counted resource map with automatic resource collection, aimed to
be used in concurrent setting.
Consider having some sort of resource that you need properly
initialised and cleaned up but only once and only for as long as there
are interested users (threads). Further, instead of only a single
resource, you want a collection of such resources, keyed on some
value.
This package implements a simple bracket-based scheme that manipulates
a resource map by counting number of initalisations and clean-ups: if
it detects that the cleanup is from the last user, it removes the
resource from the map all together. See the code/hackage for
documentation.