IJobCancel Method

Cancels all tasks in this job. Will not listen for cancellation events.
Namespace:  AGI.Parallel.Infrastructure
Assembly:  AGI.Parallel.Infrastructure (in AGI.Parallel.Infrastructure.dll) Version: 1.4.0.476 (1.4.0.476)
Syntax
void Cancel()
Examples
using System;
using System.Threading;
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();

                for (int i = 0; i < 100; ++i)
                {
                    job.AddTask(new WaitTask());
                }

                job.Submit();

                // Wait 10 seconds so the tasks queue up.
                Thread.Sleep(10000);

                // Cancel all the tasks in this job.
                job.Cancel();                

                job.WaitUntilDone();
            }
        }

        [Serializable]
        class WaitTask : Task
        {
            public override void Execute()
            {
                for (int i = 0; i < 100; ++i)
                {
                    Thread.Sleep(100);
                }
            }
        }
    }
}
See Also

STK Scalability 1.4 API for .NET