freckle-app-1.20.3.0: Haskell application toolkit used at Freckle
Safe HaskellSafe-Inferred
LanguageGHC2021

Freckle.App.Async

Synopsis

Documentation

async :: (MonadMask m, MonadUnliftIO m) => m a -> m (Async a) Source #

async but passing the thread context along

foldConcurrently :: (MonadUnliftIO m, MonadMask m, Monoid a, Foldable t) => t (m a) -> m a Source #

Run a list of actions concurrently

The forked threads will have the current thread context copied to them.

immortalCreate Source #

Arguments

:: (MonadMask m, MonadUnliftIO m) 
=> (Either SomeException () -> m ())

How to handle unexpected finish

-> m ()

The action to run persistently

-> m a 

Wrapper around creating Control.Immortal processes

Features:

  • Ensures the thread context is correctly passed to both your spawned action and your error handler
  • Blocks forever after spawning your thread.

immortalCreateLogged :: (MonadMask m, MonadUnliftIO m, MonadLogger m) => m () -> m a Source #

immortalCreate with logging of unexpected finishes