Completing the worker role
We now have all the tasks we need, so we can add them to the role:
using Microsoft.WindowsAzure.ServiceRuntime; using OrderProcessorRole.Messaging; using System; using System.Diagnostics; using System.Threading.Tasks; namespace OrderProcessorRole { public class WorkerRole : RoleEntryPoint { private OrderTopicProcessor _orderTopicProcessor = null; private BatchQueueProcessor _batchQueueProcessor = null; private StockQueueProcessor _stockQueueProcessor = null; public override void Run() { Trace.TraceInformation("OrderProcessorRole.WorkerRole.Run - Begin"); try { // WaitAll tasks will block Run until they have all completed, otherwise the role will recycle itself Task.WaitAll( Task.Run(() => this._orderTopicProcessor.ProcessSubscriptionAsync()), Task.Run(() => this._batchQueueProcessor.ProcessQueueAsync...