async-extras-0.1.3.2: Extra Utilities for the Async Library

Safe HaskellNone
LanguageHaskell2010

Control.Concurrent.Async.Lifted.Extra

Synopsis

Documentation

sequencePool :: (Traversable t, MonadBaseControl IO m) => Int -> t (m a) -> m (t a) Source #

Implementation derived from Petr Pudlák's answer on StackOverflow http://stackoverflow.com/a/18898822/230050

mapPool :: (Traversable t, MonadBaseControl IO m) => Int -> (a -> m b) -> t a -> m (t b) Source #

Implementation copied from Petr Pudlák's answer on StackOverflow http://stackoverflow.com/a/18898822/230050

forConcurrently_ :: (Foldable t, MonadBaseControl IO m) => t a -> (a -> m b) -> m () Source #

fixAsync :: (MonadFix m, MonadBaseControl IO m) => (Async (StM m a) -> m a) -> m (Async (StM m a)) Source #

Create an Async and pass it to itself.

fixAsyncBound :: (MonadFix m, MonadBaseControl IO m) => (Async (StM m a) -> m a) -> m (Async (StM m a)) Source #

Like fixAsync but using forkOS internally.

fixAsyncOn :: (MonadFix m, MonadBaseControl IO m) => Int -> (Async (StM m a) -> m a) -> m (Async (StM m a)) Source #

Like fixAsync but using forkOn internally.

fixAsyncWithUnmask :: (MonadFix m, MonadBaseControl IO m) => (Async (StM m a) -> (forall b. m b -> m b) -> m a) -> m (Async (StM m a)) Source #

Like fixAsync but using forkIOWithUnmask internally. The child thread is passed a function that can be used to unmask asynchronous exceptions.

fixAsyncOnWithUnmask :: (MonadFix m, MonadBaseControl IO m) => Int -> (Async (StM m a) -> (forall b. m b -> m b) -> m a) -> m (Async (StM m a)) Source #

Like fixAsyncOn but using forkOnWithUnmask internally. The child thread is passed a function that can be used to unmask asynchronous exceptions.

withParent :: MonadBaseControl IO m => Async a -> m b -> m (Async (StM m b)) Source #

Create an async that is linked to a parent. If the parent dies so does this async