HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Moduleasync-2.2.6Haskell2010

Control.Concurrent.Async.Warden

A more flexible way to create Asyncs and have them automatically cancelled when the Warden is shut down.

  • 2 types
  • 6 values
  • Packageasync-2.2.6
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceWarden.hs
valueshutdown :: Warden -> IO ()
#

Shutdown a Warden, calling cancel on all owned threads. Subsequent calls to spawn and shutdown will be no-ops.

Note that any exceptions thrown by the threads will be ignored. If you want exceptions to be propagated, either call wait explicitly on the Async, or use link.

valuespawnMask :: Warden -> ((forall b. IO b -> IO b) -> IO a) -> IO (Async a)
#

Spawn a thread with masked exceptions and pass an unmask function to the action.