supervisors 0.1.0.0 → 0.2.0.0
raw patch · 3 files changed
+15/−12 lines, 3 filesdep +safe-exceptionsdep −unliftiodep ~basedep ~hspec
Dependencies added: safe-exceptions
Dependencies removed: unliftio
Dependency ranges changed: base, hspec
Files
- CHANGELOG.md +6/−1
- src/Supervisors.hs +5/−7
- supervisors.cabal +4/−4
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for supervisors -## 0.1.0.0 -- YYYY-mm-dd+## 0.2.0.0 -- 2018-12-18++* Make the type of `withSupervisor` more general.+* Drop unneeded dependency on `unliftio`.++## 0.1.0.0 -- 2018-11-10 * First version. Released on an unsuspecting world.
src/Supervisors.hs view
@@ -19,16 +19,14 @@ , superviseSTM ) where -import UnliftIO.STM+import Control.Concurrent.STM -import Control.Concurrent- (ThreadId, forkIO, myThreadId, threadDelay, throwTo)+import Control.Concurrent (ThreadId, forkIO, myThreadId, throwTo) import Control.Concurrent.Async (withAsync)-import Control.Concurrent.STM (throwSTM)+import Control.Exception.Safe+ (Exception, SomeException, bracket, bracket_, toException, withException) import Control.Monad (forever, void) import Data.Foldable (traverse_)-import UnliftIO.Exception- (Exception, SomeException, bracket, bracket_, toException, withException) import qualified Data.Set as S @@ -60,7 +58,7 @@ -- | Run an IO action with access to a supervisor. Threads spawned using the -- supervisor will be killed when the action returns.-withSupervisor :: (Supervisor -> IO ()) -> IO ()+withSupervisor :: (Supervisor -> IO a) -> IO a withSupervisor f = do sup <- newSupervisor withAsync (runSupervisor sup) $ const (f sup)
supervisors.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: supervisors-version: 0.1.0.0+version: 0.2.0.0 stability: Experimental synopsis: Monitor groups of threads with non-hierarchical lifetimes. description:@@ -39,7 +39,7 @@ common shared-opts build-depends:- base ^>=4.12+ base >=4.11 && <4.13 library import: shared-opts@@ -47,8 +47,8 @@ hs-source-dirs: src/ build-depends: stm ^>=2.5- , containers ^>=0.6- , unliftio ^>=0.2.8+ , containers >=0.5.9 && <0.7+ , safe-exceptions ^>= 0.1.7 , async ^>=2.2.1 default-language: Haskell2010