Beispiel #1
0
        public void AddToQueue(TaskBase workTask)
        {
            var task = new TaskBase()
                {
                    EventName = workTask.EventName,
                    Parameters = new Dictionary<string, object>(workTask.Parameters) // create a copy
                };

            _tasksQueue.Add(task);

            if (_taskInvoker == null || _taskInvoker.IsCompleted)
                _taskInvoker = Task.Factory.StartNew(Consume, _cancellationSource.Token);
        }
Beispiel #2
0
 public void Background()
 {
     "Given a task"
         ._(() => this.task = new FakeTask());
 }