Changeset 6168 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/JobDownloader.cs
- Timestamp:
- 05/09/11 14:12:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/JobDownloader.cs
r6111 r6168 20 20 } 21 21 22 public void DownloadJob(Guid jobId, Action< T> onFinishedAction) {22 public void DownloadJob(Guid jobId, Action<Guid, T, Exception> onFinishedAction) { 23 23 Task<JobData>.Factory.StartNew((x) => DownloadJob(x), jobId) 24 24 .ContinueWith((x) => DeserializeJob(x.Result)) 25 .ContinueWith((x) => OnJobFinished( x.Result, onFinishedAction), TaskContinuationOptions.ExecuteSynchronously);25 .ContinueWith((x) => OnJobFinished(jobId, x, onFinishedAction), TaskContinuationOptions.ExecuteSynchronously); 26 26 } 27 27 28 private T OnJobFinished(T job, Action<T> onFinishedAction) { 29 onFinishedAction(job); 30 return job; 28 private void OnJobFinished(Guid jobId, Task<T> task, Action<Guid, T, Exception> onFinishedAction) { 29 onFinishedAction(jobId, task.Result, task.Exception); 31 30 } 32 31
Note: See TracChangeset
for help on using the changeset viewer.