Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- 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 |
:: 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.