JobTaskStateChanged Event |
Namespace: AGI.Parallel.Client
using System; using AGI.Parallel.Client; using AGI.Parallel.Infrastructure; namespace CodeSamples { class Program { static void Main(string[] args) { using (IJobScheduler scheduler = new ClusterJobScheduler("localhost")) { scheduler.Connect(); Job job = scheduler.CreateJob(); job.AddTask(new OurTask()); job.TaskStateChanged += new EventHandler<TaskStatusChangedEventArgs>(OnTaskStatusChangedEventHandler); job.Submit(); job.WaitUntilDone(); } } private static void OnTaskStatusChangedEventHandler(object sender, TaskStatusChangedEventArgs taskState) { Console.WriteLine("Task Name: " + taskState.Task.Name); Console.WriteLine("Status changed from " + taskState.PreviousStatus + " to " + taskState.NewStatus); } } [Serializable] class OurTask : Task { public override void Execute() { } } }
STK Parallel Computing Server 2.9 API for .NET