| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Async.Combinators
Contents
Synopsis
- data WorkerExited
- withWorker :: MonadUnliftIO m => Text -> m () -> m b -> m b
Running forever
data WorkerExited Source #
Asynchronous exception thrown to the main thread if the worker exits.
Constructors
| WorkerExited Text | Worker returned |
| WorkerFailed Text SomeException | Worker crashed |
Instances
| Show WorkerExited Source # | |
Defined in Async.Combinators Methods showsPrec :: Int -> WorkerExited -> ShowS # show :: WorkerExited -> String # showList :: [WorkerExited] -> ShowS # | |
| Exception WorkerExited Source # | |
Defined in Async.Combinators Methods toException :: WorkerExited -> SomeException # fromException :: SomeException -> Maybe WorkerExited # displayException :: WorkerExited -> String # | |
Arguments
| :: MonadUnliftIO m | |
| => Text | Human-readable name for the forked thread |
| -> m () | Action performed by the worker |
| -> m b | Action performed in current thread |
| -> m b |
Like withAsync, but makes sure that the worker thread will
not exit, neither by returning, nor by throwing an exception.
If it exits, a WorkerExited exception will be thrown in the current thread.