lifetimes 0.1.0.0 → 0.2.0.0
raw patch · 3 files changed
+20/−2 lines, 3 filesdep +asyncPVP ok
version bump matches the API change (PVP)
Dependencies added: async
API changes (from Hackage documentation)
+ Lifetimes.Async: acquireAsync :: IO a -> Acquire (Async a)
Files
- CHANGELOG.md +4/−0
- lifetimes.cabal +4/−2
- src/Lifetimes/Async.hs +12/−0
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.2.0.0++Add a Lifetimes.Async module that integrates with the `async` package.+ # 0.1.0.0 First release.
lifetimes.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: lifetimes-version: 0.1.0.0+version: 0.2.0.0 synopsis: Flexible manual resource management description: The lifetimes package provides support for manual resource management,@@ -18,7 +18,7 @@ license-file: LICENSE author: Ian Denhardt maintainer: ian@zenhack.net-copyright: 2021 Ian Denhardt+copyright: 2021-2023 Ian Denhardt -- category: -- Codec -- Concurrency@@ -55,6 +55,7 @@ , OverloadedStrings build-depends: base >=4.12 && <5+ , async ^>=2.2.4 , containers ^>=0.6.2 , stm ^>=2.5 , monad-stm ^>=0.1@@ -67,6 +68,7 @@ hs-source-dirs: src exposed-modules: Lifetimes+ , Lifetimes.Async , Lifetimes.Rc , Lifetimes.Gc test-suite tests
+ src/Lifetimes/Async.hs view
@@ -0,0 +1,12 @@+-- | Module: Lifetimes.Async+-- Description: Lifteimes integration for the async package.+module Lifetimes.Async (acquireAsync) where++import Control.Concurrent.Async (Async, async, cancel, wait)+import Lifetimes+import Zhp++-- | Spawn an async task. When it is time to reclaim the resource, 'cancel'+-- will be called.+acquireAsync :: IO a -> Acquire (Async a)+acquireAsync io = mkAcquire (async io) cancel