Represents an individual task in the system. The task provides the function to run remotely.
Namespace: AGI.Parallel.Infrastructure
Assembly: AGI.Parallel.Infrastructure (in AGI.Parallel.Infrastructure.dll) Version: 1.2.0.275 (1.2.0.275)

Syntax

C#
[SerializableAttribute]
public abstract class Task
Visual Basic
<SerializableAttribute> _
Public MustInherit Class Task

Remarks

You must implement this class so that it can be serialized by the .NET binary serializer. Add the SerializableAttribute attribute to your class and any other fields that this class references.

Examples

  Copy imageCopy
// You must always make the Task class serializable
[Serializable]
public class SimpleTask : Task
{
    // The instance of the class is automatically serialized with the task
    private int a;
    private int b;

    public SimpleTask(int first, int second)
    {
        a = first;
        b = second;
    }

    public override void Execute()
    {
        // Put your application logic in the Execute method
        Result = a + b;
    }
}

Inheritance Hierarchy

System..::..Object
  AGI.Parallel.Infrastructure..::..Task

See Also