-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A lightweight structured concurrency library -- -- A lightweight structured concurrency library. -- -- For a variant of this API generalized to -- MonadUnliftIO, see ki-unlifted. -- -- Remember to link your program with -threaded to use the -- threaded runtime! @package ki @version 1.0.0 -- | ki is a lightweight structured concurrency library. -- -- For a variant of this API generalized to -- MonadUnliftIO, see ki-unlifted. -- -- Remember to link your program with -threaded to use the -- threaded runtime! module Ki -- | A scope. -- --

👉 Details

-- -- -- -- data Scope -- | A thread. -- --

👉 Details

-- -- -- -- data Thread a -- | Open a scope, perform an IO action with it, then close the scope. -- --

👉 Details

-- -- -- -- scoped :: (Scope -> IO a) -> IO a -- | Create a child thread to execute an action within a scope. -- -- Note: The child thread does not mask asynchronous exceptions, -- regardless of the parent thread's masking state. To create a child -- thread with a different initial masking state, use forkWith. fork :: Scope -> IO a -> IO (Thread a) -- | Like fork, but the child thread does not propagate exceptions -- that are both: -- -- forkTry :: forall e a. Exception e => Scope -> IO a -> IO (Thread (Either e a)) -- | Wait for a thread to terminate. await :: Thread a -> STM a -- | Wait until all threads created within a scope terminate. awaitAll :: Scope -> STM () -- | Variant of fork for threads that never return. fork_ :: Scope -> IO Void -> IO () -- | Variant of fork that takes an additional options argument. forkWith :: Scope -> ThreadOptions -> IO a -> IO (Thread a) -- | Variant of forkWith for threads that never return. forkWith_ :: Scope -> ThreadOptions -> IO Void -> IO () -- | Variant of forkTry that takes an additional options argument. forkTryWith :: forall e a. Exception e => Scope -> ThreadOptions -> IO a -> IO (Thread (Either e a)) -- | data ThreadOptions ThreadOptions :: ThreadAffinity -> Maybe ByteCount -> String -> MaskingState -> ThreadOptions [$sel:affinity:ThreadOptions] :: ThreadOptions -> ThreadAffinity [$sel:allocationLimit:ThreadOptions] :: ThreadOptions -> Maybe ByteCount [$sel:label:ThreadOptions] :: ThreadOptions -> String [$sel:maskingState:ThreadOptions] :: ThreadOptions -> MaskingState -- | Default thread options. -- --
--   ThreadOptions
--     { affinity = Nothing
--     , allocationLimit = Nothing
--     , label = ""
--     , maskingState = Unmasked
--     }
--   
defaultThreadOptions :: ThreadOptions -- | What, if anything, a thread is bound to. data ThreadAffinity -- | Unbound. Unbound :: ThreadAffinity -- | Bound to a capability. Capability :: Int -> ThreadAffinity -- | Bound to an OS thread. OsThread :: ThreadAffinity -- | A number of bytes. data ByteCount -- | A number of kilobytes. kilobytes :: Natural -> ByteCount -- | A number of megabytes. megabytes :: Natural -> ByteCount