Example #1
0
        public void Client_ExecuteTask_Test()
        {
            ITaskBroker client = new GridTaskBrokerClient(new GridTaskBrokerCallback());
            client.Start();
            Task task = new Task();

            foreach (IComputeEngine engine in _engines)
            {
                engine.ResourcePath = System.IO.Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\SybilResearch.MultiNode.SampleCustomerCode\\bin\\Debug");
                client.RegisterEngineId(engine.EngineId);
            }

            for (int i = 0; i < 1; i++)
            {
                task.TaskId = Guid.NewGuid().ToString();

                task.Assembly = "SybilResearch.MultiNode.SampleCustomerCode";
                task.TypeName = "SybilResearch.MultiNode.SampleCustomerCode.SentenceRepeater";
                task.MethodName = "RepeatSentencesWithParams";

                RequestHandle handle = client.ExecuteTask(task);
                _log.DebugFormat("Handle submit time: {0} - {1}", handle.TaskStatus.ToString(), handle.SubmitTime);
            }

            Thread.Sleep(TimeSpan.FromHours(1));

            (client as GridTaskBrokerClient).Close();
        }
Example #2
0
        public void Client_ExecuteTask_Test()
        {
            ITaskBroker client = new GridTaskBrokerClient(new GridTaskBrokerCallback());

            client.Start();
            Task task = new Task();

            foreach (IComputeEngine engine in _engines)
            {
                engine.ResourcePath = System.IO.Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\SybilResearch.MultiNode.SampleCustomerCode\\bin\\Debug");
                client.RegisterEngineId(engine.EngineId);
            }

            for (int i = 0; i < 1; i++)
            {
                task.TaskId = Guid.NewGuid().ToString();

                task.Assembly   = "SybilResearch.MultiNode.SampleCustomerCode";
                task.TypeName   = "SybilResearch.MultiNode.SampleCustomerCode.SentenceRepeater";
                task.MethodName = "RepeatSentencesWithParams";

                RequestHandle handle = client.ExecuteTask(task);
                _log.DebugFormat("Handle submit time: {0} - {1}", handle.TaskStatus.ToString(), handle.SubmitTime);
            }

            Thread.Sleep(TimeSpan.FromHours(1));

            (client as GridTaskBrokerClient).Close();
        }
Example #3
0
        public void Client_Register_EngineId()
        {
            ITaskBroker client = new GridTaskBrokerClient(new GridTaskBrokerCallback());

            foreach (IComputeEngine engine in _engines)
            {
                client.RegisterEngineId(engine.EngineId);
            }
        }
Example #4
0
 public void Client_Unregister_Engine()
 {
     ITaskBroker client = new GridTaskBrokerClient(new GridTaskBrokerCallback());
     foreach (IComputeEngine engine in _engines)
     {
         client.RegisterEngineId(engine.EngineId);
     }
     foreach (IComputeEngine engine in _engines)
     {
         client.UnregisterEngine(engine.EngineId);
     }
 }