concurrent-resource-map: Concurrent resource map

[ bsd3, data, library ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.2.0.0
Change log ChangeLog.md
Dependencies base [details]
Tested with ghc ==8.10.1 || ==8.8.3 || ==8.6.3 || ==8.4.4 || ==8.2.2 || ==8.0.2 || ==7.10.3
License BSD-3-Clause
Copyright 2020 Mateusz Kowalczyk
Author Mateusz Kowalczyk
Maintainer fuuzetsu@fuuzetsu.co.uk
Category Data
Home page https://github.com/Fuuzetsu/concurrent-resource-map#readme
Bug tracker https://github.com/Fuuzetsu/concurrent-resource-map/issues
Source repo head: git clone https://github.com/Fuuzetsu/concurrent-resource-map
Uploaded by MateuszKowalczyk at 2020-03-18T03:24:32Z
Distributions NixOS:0.2.0.0
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 801 total (13 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-03-18 [all 1 reports]

Readme for concurrent-resource-map-0.2.0.0

[back to package description]

concurrent-resource-map Build Status

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.