Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
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.
WorkerExited Text | Worker returned |
WorkerFailed Text SomeException | Worker crashed |
Instances
Show WorkerExited Source # | |
Defined in Async.Combinators showsPrec :: Int -> WorkerExited -> ShowS # show :: WorkerExited -> String # showList :: [WorkerExited] -> ShowS # | |
Exception WorkerExited Source # | |
Defined in Async.Combinators |
:: 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.