Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.Slave.AzureClient/WorkerRole.cs @ 6990

Last change on this file since 6990 was 6990, checked in by spimming, 12 years ago

#1680:

  • AzureClient initial commit
  • Azure project added
  • WorkerRole for starting the slave core
File size: 819 bytes
Line 
1using System.Net;
2using System.Threading;
3using HeuristicLab.Clients.Hive.SlaveCore;
4using Microsoft.WindowsAzure.ServiceRuntime;
5
6namespace HeuristicLab.Clients.Hive.Slave.AzureClient {
7  public class WorkerRole : RoleEntryPoint {
8    private Core core;
9    private Thread coreThread;
10
11    public override void Run() {
12      core = new Core(false);
13      coreThread = new Thread(core.Start);
14      coreThread.Start();
15
16      while (true) {
17        Thread.Sleep(10000);
18        //Trace.WriteLine("Working", "Information");
19      }
20    }
21
22    public override bool OnStart() {
23      ServicePointManager.DefaultConnectionLimit = 12;
24      core = new Core();
25      return base.OnStart();
26    }
27
28    public override void OnStop() {
29      core.Shutdown();
30      base.OnStop();
31    }
32  }
33}
Note: See TracBrowser for help on using the repository browser.