[This is preliminary documentation and is subject to change.]

Provides a simple multi-threaded processsor for IBuildTask objects.

Namespace: org.critterai.nmbuild
Assembly: cai-nmbuild (in cai-nmbuild.dll) Version: 0.4.0.0 (0.4.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public sealed class BuildTaskProcessor
Public NotInheritable Class BuildTaskProcessor
public ref class BuildTaskProcessor sealed

Members

               
 All Members  Constructors   Fields   Properties   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
BuildTaskProcessor(Int32)
Constructor
Abort()()()()
Aborts the processor.
HighPriority
A standard value for high priority tasks.
IdleSleep
The length of time the processor will idle when there are no tasks to process. [Units: Milliseconds] [Limit: >= 1]
IsRunning
The processor is running.
LowPriority
A standard value for low priority tasks.
MaxConcurrent
The maximum permitted active tasks before new tasks are queued.
MediumPriority
A standard value for medium priority tasks.
QueueTask(IBuildTask)
Queues a task to be run.
Run()()()()
Runs the processor.
StandardSleep
The length of time the processor will idle when there are tasks being processed. [Units: Milliseconds] [Limit: >= 1]
TaskCount
The number of active and queued tasks.

Remarks

The expected use case is that the processor is run on a separate thread. Clients then create and pass it tasks to be run. The processor will run tasks concurrently up to its maximum allowed, then queue remaining tasks for later.

Individual tasks are aborted via the Abort(String) method. The processor will clear the task from its queue when it encounters the task for processing, so the task count will not decrement immediately.

Warning: A zombie worker thread will result if a task does not meet its IBuildTask obligation by throwing an exception in its Run()()()() method. The worker thread will become un-usable for new tasks.

Inheritance Hierarchy

System..::..Object
  org.critterai.nmbuild..::..BuildTaskProcessor

See Also