lifetimes 0.2.0.0 → 0.2.0.1
raw patch · 2 files changed
+4/−4 lines, 2 files
Files
- lifetimes.cabal +1/−1
- src/Lifetimes/Async.hs +3/−3
lifetimes.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: lifetimes-version: 0.2.0.0+version: 0.2.0.1 synopsis: Flexible manual resource management description: The lifetimes package provides support for manual resource management,
src/Lifetimes/Async.hs view
@@ -2,11 +2,11 @@ -- Description: Lifteimes integration for the async package. module Lifetimes.Async (acquireAsync) where -import Control.Concurrent.Async (Async, async, cancel, wait)+import Control.Concurrent.Async (Async, async, cancel, waitCatch) import Lifetimes import Zhp -- | Spawn an async task. When it is time to reclaim the resource, 'cancel'--- will be called.+-- will be called, and the task will be waited on. acquireAsync :: IO a -> Acquire (Async a)-acquireAsync io = mkAcquire (async io) cancel+acquireAsync io = mkAcquire (async io) (\a -> cancel a <* waitCatch a)