Inheritance: Chinchilla.Worker
Esempio n. 1
0
        public Task DeliverOnTask(IDelivery delivery)
        {
            var worker = new TaskWorker(connectedProcessor);
            workers.TryAdd(worker.GetHashCode(), worker);

            var currentDelivery = delivery;

            return Task.Factory.StartNew(() =>
            {
                worker.Deliver(currentDelivery);

                TaskWorker removed;
                workers.TryRemove(worker.GetHashCode(), out removed);
            });
        }