spago-0.21.0

Safe Haskell | None
Language | Haskell2010

Spago.Async

Synopsis

- async :: MonadUnliftIO m => TaskGroup -> m a -> m (Async a)
- wait :: MonadIO m => Async a -> m a
- waitCatch :: MonadIO m => Async a -> m (Either SomeException a)
- cancel :: MonadIO m => Async a -> m ()
- withTaskGroup :: MonadUnliftIO m => Int -> (TaskGroup -> m b) -> m b
- mapTasks :: Traversable t => TaskGroup -> t (RIO env a) -> RIO env (t a)
- data Async a

# Documentation

async :: MonadUnliftIO m => TaskGroup -> m a -> m (Async a) #

wait :: MonadIO m => Async a -> m a #

waitCatch :: MonadIO m => Async a -> m (Either SomeException a) #

cancel :: MonadIO m => Async a -> m () #

withTaskGroup :: MonadUnliftIO m => Int -> (TaskGroup -> m b) -> m b #

mapTasks :: Traversable t => TaskGroup -> t (RIO env a) -> RIO env (t a) #

data Async a #

An asynchronous action spawned by `async` or `withAsync`. Asynchronous actions are executed in a separate thread, and operations are provided for waiting for asynchronous actions to complete and obtaining their results (see e.g. `wait`).

#### Instances

Instances details

Functor Async |
Instance details Defined in Control.Concurrent.Async.Pool.Async Methods fmap :: (a -> b) -> Async a -> Async b # (<$) :: a -> Async b -> Async a #
Eq (Async a) |
Instance details Defined in Control.Concurrent.Async.Pool.Async Methods (==) :: Async a -> Async a -> Bool # (/=) :: Async a -> Async a -> Bool #
Ord (Async a) |
Instance details Defined in Control.Concurrent.Async.Pool.Async Methods compare :: Async a -> Async a -> Ordering # (<) :: Async a -> Async a -> Bool # (<=) :: Async a -> Async a -> Bool # (>) :: Async a -> Async a -> Bool # (>=) :: Async a -> Async a -> Bool # max :: Async a -> Async a -> Async a # min :: Async a -> Async a -> Async a #