supervisors 0.2.0.0 → 0.2.1.0
raw patch · 3 files changed
+23/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- src/Supervisors.hs +15/−3
- supervisors.cabal +3/−3
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for supervisors +## 0.2.1.0 -- 2020-01-26++* Fix a bug that could potentially result in some threads not being+ killed.+ ## 0.2.0.0 -- 2018-12-18 * Make the type of `withSupervisor` more general.
src/Supervisors.hs view
@@ -24,9 +24,15 @@ import Control.Concurrent (ThreadId, forkIO, myThreadId, throwTo) import Control.Concurrent.Async (withAsync) import Control.Exception.Safe- (Exception, SomeException, bracket, bracket_, toException, withException)+ ( Exception+ , SomeException+ , bracket+ , bracket_+ , finally+ , toException+ , withException+ ) import Control.Monad (forever, void)-import Data.Foldable (traverse_) import qualified Data.Set as S @@ -73,7 +79,13 @@ Right kids -> do writeTVar stateVar $ Left (toException exn) pure kids)- (traverse_ (`throwTo` exn))+ (foldr+ -- important: chain these together with `finally`,+ -- rather than (>>=) or friends, so that if one+ -- throws an exception we still run the others.+ (\kid old -> throwTo kid exn `finally` old)+ (pure ())+ ) (\_ -> pure ()) -- | Launch the IO action in a thread, monitored by the 'Supervisor'. If the
supervisors.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: supervisors-version: 0.2.0.0+version: 0.2.1.0 stability: Experimental synopsis: Monitor groups of threads with non-hierarchical lifetimes. description:@@ -39,7 +39,7 @@ common shared-opts build-depends:- base >=4.11 && <4.13+ base >=4.11 && <5 library import: shared-opts@@ -59,7 +59,7 @@ hs-source-dirs: tests/ build-depends: supervisors- , hspec ^>=2.6.0+ , hspec >=2.6.0 && <2.8 default-language: Haskell2010 source-repository head