async-combinators-0.0.1: Async combinators

Safe HaskellSafe
LanguageHaskell2010

Async.Combinators

Contents

Synopsis

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

withWorker Source #

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.