Example #1
0
        private static IEnumerable <BatchedWorkItem> GetWorkItems(IReadOnlyCollection <Uri> fileLocations, IWorkBatchFactory workBatchFactory, string batchId = null)
        {
            var batch = workBatchFactory.Create(fileLocations.Count, new BlobWatcherWorkBatch(batchId, ProcessResults));

            FormattedConsole.WriteLine($"Created batch {batch.Id} with {fileLocations.Count} blobs");

            return(fileLocations
                   .Select(uri => new BatchedWorkItem(batch, new BlobWatcherWorkItem(uri.AbsoluteUri, batch))));
        }
Example #2
0
        private IEnumerable <BatchedWorkItem> GetWorkItems(IWorkBatchFactory workBatchFactory, bool startup = false)
        {
            var workBatch = workBatchFactory.Create(3, new DummyWorkBatch(), startup: startup);

            var workItems = new List <BatchedWorkItem>();

            for (var i = 0; i < 3; i++)
            {
                workItems.Add(new BatchedWorkItem(workBatch, new DummyWorkItem(_rand.Next(0, 100).ToString())));
            }

            FormattedConsole.WriteLine($"Producer {ProducerId} has created {workItems[0].Id}, {workItems[1].Id}, {workItems[2].Id}");

            return(workItems);
        }