public ProgressJob Execute(Action<ProgressJob> action)
        {
            var job = new ProgressJob(Guid.NewGuid().ToString());

            // this will (should!) never fail, because job.Id is globally unique
            _runningJobs.TryAdd(job.Id, job);

            Task.Factory.StartNew(() =>
            {
                action(job);
                job.ReportComplete();
                _runningJobs.TryRemove(job.Id, out job);
            },
            TaskCreationOptions.LongRunning);

            _monitor.BroadcastJobStatus(job);

            return job;
        }
 public void BroadcastJobStatus(ProgressJob progressJob)
 {
     progressJob.ProgressChanged += HandleJobProgressChanged;
     progressJob.Completed += HandleJobCompleted;
 }