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

Safe HaskellSafe-Inferred

Control.Concurrent.Async.Extra

Synopsis

Documentation

sequencePool :: Traversable t => Int -> t (IO a) -> IO (t a)Source

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

mapPool :: Traversable t => Int -> (a -> IO b) -> t a -> IO (t b)Source

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

fixAsync :: (Async a -> IO a) -> IO (Async a)Source

Create an Async and pass it to itself.

fixAsyncBound :: (Async a -> IO a) -> IO (Async a)Source

Like fixAsync but using forkOS internally.

fixAsyncOn :: Int -> (Async a -> IO a) -> IO (Async a)Source

Like fixAsync but using forkOn internally.

fixAsyncWithUnmask :: (Async a -> (forall b. IO b -> IO b) -> IO a) -> IO (Async a)Source

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

fixAsyncOnWithUnmask :: Int -> (Async a -> (forall b. IO b -> IO b) -> IO a) -> IO (Async a)Source

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

withParent :: Async a -> IO b -> IO (Async b)Source

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

newtype Promise a Source

Promise is like Concurrently but includes a sequential monad instance

Constructors

Promise 

Fields

unPromise :: IO a