Last change
on this file since 7004 was
6990,
checked in by spimming, 13 years ago
|
#1680:
- AzureClient initial commit
- Azure project added
- WorkerRole for starting the slave core
|
File size:
819 bytes
|
Line | |
---|
1 | using System.Net;
|
---|
2 | using System.Threading;
|
---|
3 | using HeuristicLab.Clients.Hive.SlaveCore;
|
---|
4 | using Microsoft.WindowsAzure.ServiceRuntime;
|
---|
5 |
|
---|
6 | namespace 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.