예제 #1
0
        private void RunJob(ServiceJob job)
        {
            lock (_jobsInWork)
            {
                if (_jobsInWork.ContainsKey(job))
                {
                    return;
                }

                _jobsInWork.Add(job, Task.Factory.StartNew(OnJobExecute, job));
            }
        }
예제 #2
0
		/// <summary>
		/// Add service job to jobs list for an execution
		/// </summary>
		/// <param name="job">Service job</param>
		protected void AddJob(ServiceJob job)
		{
			_jobsList.Add(job);
		}
예제 #3
0
		/// <summary>
		/// Signal service what job has been completed
		/// </summary>
		/// <param name="job">Your ServiceJob instance</param>
		public void SetJobFinished(ServiceJob job)
		{
			_jobsInWork.Remove(job);	
		}
예제 #4
0
		private void RunJob(ServiceJob job)
		{
			lock (_jobsInWork)
			{
				if (_jobsInWork.ContainsKey(job))
					return;

				_jobsInWork.Add(job, Task.Factory.StartNew(OnJobExecute, job));
			}
		}
예제 #5
0
 /// <summary>
 /// Add service job to jobs list for an execution
 /// </summary>
 /// <param name="job">Service job</param>
 protected void AddJob(ServiceJob job)
 {
     _jobsList.Add(job);
 }
예제 #6
0
 /// <summary>
 /// Signal service what job has been completed
 /// </summary>
 /// <param name="job">Your ServiceJob instance</param>
 public void SetJobFinished(ServiceJob job)
 {
     _jobsInWork.Remove(job);
 }