Exemple #1
0
 public CollectorWorker(StatelessServiceContext context)
     : base(context)
 {
     rand      = new Random();
     log       = new ServiceLogger(this);
     performer = new JobPerformer(log);
 }
Exemple #2
0
        public QueueReader(ServiceLogger log, JobPerformer performer)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);

            // Create the queue client
            CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();

            var queueName = ConfigurationManager.AppSettings["QueueName"];

            // Retrieve a reference to a queue
            _queue     = queueClient.GetQueueReference(queueName);
            _performer = performer;
            _watch     = new AverageStopWatch();
            _log       = log;
            log.LogInfo("QueueName", queueName);
        }