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

Safe HaskellSafe
LanguageHaskell2010

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

sequenceConcurrently :: Traversable t => t (IO a) -> IO (t a) Source #

mapConcurrently_ :: Foldable t => (a -> IO b) -> t a -> IO () Source #

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

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

Instances

Monad Promise Source # 

Methods

(>>=) :: Promise a -> (a -> Promise b) -> Promise b #

(>>) :: Promise a -> Promise b -> Promise b #

return :: a -> Promise a #

fail :: String -> Promise a #

Functor Promise Source # 

Methods

fmap :: (a -> b) -> Promise a -> Promise b #

(<$) :: a -> Promise b -> Promise a #

Applicative Promise Source # 

Methods

pure :: a -> Promise a #

(<*>) :: Promise (a -> b) -> Promise a -> Promise b #

(*>) :: Promise a -> Promise b -> Promise b #

(<*) :: Promise a -> Promise b -> Promise a #

Alternative Promise Source # 

Methods

empty :: Promise a #

(<|>) :: Promise a -> Promise a -> Promise a #

some :: Promise a -> Promise [a] #

many :: Promise a -> Promise [a] #

MonadPlus Promise Source # 

Methods

mzero :: Promise a #

mplus :: Promise a -> Promise a -> Promise a #