Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type ScopedAsync s a = ScopedResource s (Async a)
- async :: MonadUnliftIO m => m a -> Scoped s m (ScopedAsync s a)
- asyncBound :: MonadUnliftIO m => m a -> Scoped s m (ScopedAsync s a)
- wait :: MonadIO m => ScopedAsync s a -> Scoped s m a
- waitCatch :: MonadIO m => ScopedAsync s a -> Scoped s m (Either SomeException a)
- waitScoped :: MonadUnliftIO m => ScopedAsync s a -> Scoped s m ()
- waitCatchScoped :: MonadUnliftIO m => ScopedAsync s a -> Scoped s m ()
Scoped Async
type ScopedAsync s a = ScopedResource s (Async a) Source #
Allocating a new ScopedAsync
in a Scoped
block
async :: MonadUnliftIO m => m a -> Scoped s m (ScopedAsync s a) Source #
asyncBound :: MonadUnliftIO m => m a -> Scoped s m (ScopedAsync s a) Source #
Waiting for a ScopedAsync
to finish
wait :: MonadIO m => ScopedAsync s a -> Scoped s m a Source #
Wait for the ScopedAsync
to finish immediately
waitCatch :: MonadIO m => ScopedAsync s a -> Scoped s m (Either SomeException a) Source #
Like wait
but return either
or Left
SomeException
Right
a
Waiting for a ScopedAsync
to finish as part of the handlers of the Scoped
block
waitScoped :: MonadUnliftIO m => ScopedAsync s a -> Scoped s m () Source #
waitCatchScoped :: MonadUnliftIO m => ScopedAsync s a -> Scoped s m () Source #