Provides the methods used to submit and monitor jobs to embedded scheduler.
Namespace: AGI.Parallel.Client
Assembly: AGI.Parallel.EmbeddedClient (in AGI.Parallel.EmbeddedClient.dll) Version: 1.2.0.275 (1.2.0.275)

Syntax

C#
public sealed class EmbeddedJobScheduler : IJobScheduler, 
        IDisposable, IGetHostLog, IGetVersionInfo, IMessageEndpoint
Visual Basic
Public NotInheritable Class EmbeddedJobScheduler _
        Implements IJobScheduler, IDisposable, IGetHostLog, IGetVersionInfo,  _
        IMessageEndpoint

Remarks

We recommend that instead of using this class you instead use the IJobScheduler interface if possible.

Examples

  Copy imageCopy
using System;
using AGI.Parallel.Client;
using AGI.Parallel.Infrastructure;

namespace CodeSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create the EmbeddedJobScheduler class.
            // You can optionally specify the number of cores you want to use.
            // By default, it will use the number of cores available on your machine.
            using (IJobScheduler scheduler = new EmbeddedJobScheduler(4))
            {
                // Before you use any methods on the object, you must call Connect.
                try
                {
                    scheduler.Connect();

                    // Create a job, add a task, and submit.
                    Job job = scheduler.CreateJob();
                    job.AddTask(new HelloTask());

                    job.Submit();
                    job.WaitUntilDone();
                    Console.WriteLine("Result: " + job.Tasks[0].Result);
                }
                catch (JobSchedulerException e)
                {
                    Console.WriteLine("JobSchedulerException: " + e);
                }
            }
        }

        [Serializable]
        public class HelloTask : Task
        {
            public override void Execute()
            {
                Result = "Hello from Task";
            }
        }
    }
}

Inheritance Hierarchy

System..::..Object
  AGI.Parallel.Client..::..EmbeddedJobScheduler

See Also