gang-of-threads-0.0.2: Non-deterministic parallelism with bags

Safe HaskellSafe-Inferred

Control.Concurrent.Bag.Task

Synopsis

Documentation

newtype Task b r a Source

A monad in which tasks can be specified. Task is instancing MonadIO and it therefore has the function liftIO to perform arbitrary IO actions. Tasks may or may not return a value. If it returns a value, this value is written back as a result. Additionally there is a function addTask to add new tasks to the bag. The parameter r is the result type of the corresponding bag.

Constructors

Task 

Fields

getTaskReader :: ReaderT (Bag b r) IO a
 

Instances

Monad (Task b r) 
Functor (Task b r) 
Applicative (Task b r) 
MonadIO (Task b r) 

runTask :: Task b r (Maybe r) -> Bag b r -> IO (Maybe r)Source

addTask :: TaskBufferSTM b => Task b r (Maybe r) -> Task b r ()Source

Add a task to the bag of tasks.