Exemplo n.º 1
0
 public TaskDownloader(IEnumerable <Guid> jobIds)
 {
     taskIds        = jobIds;
     taskDownloader = new ConcurrentTaskDownloader <ItemTask>(Settings.Default.MaxParallelDownloads, Settings.Default.MaxParallelDownloads);
     taskDownloader.ExceptionOccured += new EventHandler <EventArgs <Exception> >(taskDownloader_ExceptionOccured);
     results = new Dictionary <Guid, HiveTask>();
 }
Exemplo n.º 2
0
 public RefreshableJob(Job hiveJob) {
   this.progress = new Progress();
   this.refreshAutomatically = true;
   this.Job = hiveJob;
   this.log = new ThreadSafeLog();
   this.jobDownloader = new ConcurrentTaskDownloader<ItemTask>(Settings.Default.MaxParallelDownloads, Settings.Default.MaxParallelDownloads);
   this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured);
   this.HiveTasks = new ItemCollection<HiveTask>();
 }
Exemplo n.º 3
0
 protected RefreshableJob(RefreshableJob original, Cloner cloner) {
   cloner.RegisterClonedObject(original, this);
   this.Job = cloner.Clone(original.Job);
   this.IsControllable = original.IsControllable;
   this.log = cloner.Clone(original.log);
   this.RefreshAutomatically = false; // do not start results polling automatically
   this.jobDownloader = new ConcurrentTaskDownloader<ItemTask>(Settings.Default.MaxParallelDownloads, Settings.Default.MaxParallelDownloads);
   this.jobDownloader.ExceptionOccured += new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured);
   this.HiveTasks = cloner.Clone(original.HiveTasks);
   this.ExecutionTime = original.ExecutionTime;
   this.ExecutionState = original.ExecutionState;
 }
Exemplo n.º 4
0
 public void Dispose() {
   if (jobDownloader != null) {
     jobDownloader.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(jobDownloader_ExceptionOccured);
     jobDownloader.Dispose();
     jobDownloader = null;
   }
   if (jobResultPoller != null) {
     DeregisterResultPollingEvents();
     jobResultPoller = null;
   }
   if (hiveTasks != null) {
     DisposeTasks();
   }
   if (job != null) {
     DeregisterJobEvents();
     job = null;
   }
 }