Changeset 1005 for trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
- Timestamp:
- 12/17/08 14:46:06 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs
r1001 r1005 51 51 Dictionary<long, Executor> engines = new Dictionary<long, Executor>(); 52 52 Dictionary<long, AppDomain> appDomains = new Dictionary<long, AppDomain>(); 53 53 Dictionary<long, Job> jobs = new Dictionary<long, Job>(); 54 54 55 private WcfService wcfService; 55 56 … … 118 119 long jId = (long)jobId; 119 120 byte[] sJob = engines[jId].GetFinishedJob(); 120 121 JobResult jobResult = new JobResult { Job Id = jId, Result = sJob, Client = ConfigManager.Instance.GetClientInfo() };121 122 JobResult jobResult = new JobResult { Job = jobs[jId], Result = sJob, Client = ConfigManager.Instance.GetClientInfo() }; 122 123 wcfService.SendJobResultAsync(jobResult, true); 123 124 } … … 148 149 149 150 PluginManager.Manager.Initialize(); 150 AppDomain appDomain = PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.Job Id.ToString(), sandboxed, typeof(TestJob));151 AppDomain appDomain = PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.Job.Id.ToString(), sandboxed, typeof(TestJob)); 151 152 appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException); 152 153 153 appDomains.Add(e.Result.JobId, appDomain); 154 jobs.Add(e.Result.Job.Id, e.Result.Job); 155 appDomains.Add(e.Result.Job.Id, appDomain); 154 156 155 157 Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName); 156 engine.JobId = e.Result.Job Id;158 engine.JobId = e.Result.Job.Id; 157 159 engine.Queue = MessageQueue.GetInstance(); 158 160 engine.Start(e.Result.SerializedJob); 159 engines.Add(e.Result.Job Id, engine);161 engines.Add(e.Result.Job.Id, engine); 160 162 161 163 ClientStatusInfo.JobsFetched++; … … 167 169 void wcfService_SendJobResultCompleted(object sender, SendJobResultCompletedEventArgs e) { 168 170 if (e.Result.Success) { 169 AppDomain.Unload(appDomains[e.Result.Job Id]);170 appDomains.Remove(e.Result.Job Id);171 engines.Remove(e.Result.Job Id);171 AppDomain.Unload(appDomains[e.Result.Job.Id]); 172 appDomains.Remove(e.Result.Job.Id); 173 engines.Remove(e.Result.Job.Id); 172 174 ClientStatusInfo.JobsProcessed++; 173 175 Debug.WriteLine("ProcessedJobs to:" + ClientStatusInfo.JobsProcessed);
Note: See TracChangeset
for help on using the changeset viewer.