Click or drag to resize

Task Class

Represents an individual task in the system. The task provides the function to run remotely.
Inheritance Hierarchy
SystemObject
  AGI.Parallel.InfrastructureTask

Namespace:  AGI.Parallel.Infrastructure
Assembly:  AGI.Parallel.Infrastructure (in AGI.Parallel.Infrastructure.dll) Version: 2.9.0.1601 (2.9.0.1601)
Syntax
[SerializableAttribute]
public abstract class Task

The Task type exposes the following members.

Constructors
  NameDescription
Protected methodTask
Initializes a new instance of the Task class
Top
Properties
  NameDescription
Public propertyId
Gets the unique handle of task.
Public propertyIsCancelling
Gets a value indicating whether this task is cancelling.
Public propertyIsFinishedTaskStatus
Gets a value indicating whether this task is finished.
Public propertyName
Gets or sets the display name of the task.
Public propertyCode exampleProperties
Gets the properties of the task.
Public propertyCode exampleResult
Gets or sets Task's execution result.
Public propertyCode exampleStandardError
Gets the standard error of the host that executed the task.
Public propertyCode exampleStandardOutput
Gets the standard output of the host that executed the task.
Public propertyCode exampleTaskCancellationMessage
Gets the optional task cancellation message.
Public propertyTaskCancellationReason
Gets the reason why the task was canceled.
Public propertyCode exampleTaskStatus
Gets the task status.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecute
Main entry point into Task when it is run on a Host.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetProperty(String)
Returns property value by name. You can find common values for properties using TaskProperties.
Public methodGetPropertyT(String)
Returns property value by name. You can find common values for properties using TaskProperties.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemoveProperty
Removes the property from the property bag. You can find common values for properties using TaskProperties.
Public methodCode exampleSetProgress(Int32)
Sets progress of task. This value will be returned with AGI.Parallel.Client.Job.TaskProgressUpdated event.
Public methodCode exampleSetProgress(Int32, Object)
Sets progress of task. This value will be returned with AGI.Parallel.Client.Job.TaskProgressUpdated event.
Public methodSetProperty(String, Object)
Sets properties on Task. You can find common values for properties using TaskProperties.
Public methodSetPropertyT(String, T)
Sets property value. You can find common values for properties using TaskProperties.
Public methodToString
Returns a String that represents this instance.
(Overrides ObjectToString.)
Top
Events
  NameDescription
Public eventCompleted
An event that is raised when this task is completed.
Public eventProgressUpdated
An event that is raised when this task's progress is updated.
Public eventStatusChanged
An event that is raised when this task's TaskStatus changes.
Top
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
// 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;
    }
}
See Also

STK Parallel Computing Server 2.9 API for .NET