My Project
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Classes | Public Member Functions | Properties | List of all members
UniExtensions.Async.MapReduce Class Reference

A simple way to spread execution of functions across multiple threads. More...

Inheritance diagram for UniExtensions.Async.MapReduce:

Public Member Functions

void Enqueue (System.Action fn)
 Add a method to the queue of tasks to be executed. More...
 
 MapReduce (int poolSize, int maxQueueSize)
 Initializes a new instance of the UniExtensions.MapReduce class. More...
 
void Dispose ()
 
void Execute (bool wait=false)
 Execute all the queued tasks. If wait is true, this method will block until all tasks are finished. More...
 

Properties

bool Done [get]
 Gets a value indicating whether this UniExtensions.MapReduce is finished executing all the queued tasks. More...
 

Detailed Description

A simple way to spread execution of functions across multiple threads.

Constructor & Destructor Documentation

UniExtensions.Async.MapReduce.MapReduce ( int  poolSize,
int  maxQueueSize 
)
inline

Initializes a new instance of the UniExtensions.MapReduce class.

Parameters
poolSizePool size. the number of threads to use.
maxQueueSizeMax queue size. the largest possible number of queued tasks.

Member Function Documentation

void UniExtensions.Async.MapReduce.Dispose ( )
inline
void UniExtensions.Async.MapReduce.Enqueue ( System.Action  fn)
inline

Add a method to the queue of tasks to be executed.

Parameters
fnFn.
void UniExtensions.Async.MapReduce.Execute ( bool  wait = false)
inline

Execute all the queued tasks. If wait is true, this method will block until all tasks are finished.

Parameters
waitIf set to true wait.

Property Documentation

bool UniExtensions.Async.MapReduce.Done
get

Gets a value indicating whether this UniExtensions.MapReduce is finished executing all the queued tasks.

true if done; otherwise, false.


The documentation for this class was generated from the following file: