freckle-app-1.23.2.0: Haskell application toolkit used at Freckle
Safe HaskellNone
LanguageGHC2021

Freckle.App.Async

Synopsis

The ThreadContext these functions preserve

UnliftIO.Async functions that preserve context

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

async but passing the thread context along

pooledMapConcurrentlyN :: (MonadUnliftIO m, MonadMask m, Traversable t) => Int -> (a -> m b) -> t a -> m (t b) Source #

pooledMapConcurrentlyN but passing the thread context along

pooledMapConcurrently :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m (t b) Source #

pooledMapConcurrently but passing the thread context along

pooledMapConcurrentlyN_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => Int -> (a -> m b) -> t a -> m () Source #

pooledMapConcurrentlyN_ but passing the thread context along

pooledMapConcurrently_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m () Source #

pooledMapConcurrently_ but passing the thread context along

pooledForConcurrentlyN :: (MonadUnliftIO m, MonadMask m, Traversable t) => Int -> t a -> (a -> m b) -> m (t b) Source #

pooledForConcurrentlyN but passing the thread context along

pooledForConcurrently :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m (t b) Source #

pooledForConcurrently but passing the thread context along

pooledForConcurrentlyN_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => Int -> t a -> (a -> m b) -> m () Source #

pooledForConcurrentlyN_ but passing the thread context along

pooledForConcurrently_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m () Source #

pooledForConcurrently_ but passing the thread context along

mapConcurrently :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m (t b) Source #

mapConcurrently but passing the thread context along

forConcurrently :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m (t b) Source #

forConcurrently but passing the thread context along

mapConcurrently_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => (a -> m b) -> t a -> m () Source #

mapConcurrently_ but passing the thread context along

forConcurrently_ :: (MonadUnliftIO m, MonadMask m, Traversable t) => t a -> (a -> m b) -> m () Source #

forConcurrently_ but passing the thread context along

Related extensions

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

Run a list of actions concurrently, combining the results monoidally

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

Control.Immortal-related functions

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