Skip to content
Snippets Groups Projects
Commit 5c1eb81f authored by Jens Nolte's avatar Jens Nolte
Browse files

Add async_ and asyncWithUnmask_


Co-authored-by: default avatarJan Beinke <git@janbeinke.com>
parent 796be3c1
No related branches found
No related tags found
No related merge requests found
Pipeline #2412 passed
module Quasar.Async (
-- * Async/await
MonadAsync(..),
async_,
asyncWithUnmask_,
-- * Task
Task,
......@@ -80,6 +82,14 @@ liftUnmask unmask action = do
liftIO $ unmask $ runReaderT action value
async_ :: MonadAsync m => m () -> m ()
async_ = void . async
asyncWithUnmask_ :: MonadAsync m => ((forall a. m a -> m a) -> m ()) -> m ()
asyncWithUnmask_ action = void $ asyncWithUnmask action
-- | A task that is running asynchronously. It has a result and can fail.
-- The result (or exception) can be aquired by using the `IsAwaitable` class (e.g. by calling `await` or `awaitIO`).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment