public void TestCleanup()
 {
     //Generic cleanup
     if (processor != null)
     {
         processor.ShutdownAsync().Wait();
         processor = null;
     }
 }
Beispiel #2
0
 static void Main(string[] args)
 {
     Params arguments = Params.ParseParams(args);
     if(arguments.IsValid)
     {
         BatchProcessor processor = new BatchProcessor(arguments);
         processor.Run();
     }
 }
Beispiel #3
0
        private static void Main(string[] args)
        {
            {
                Params arguments = new Params(args);

                if (arguments.IsValid)
                {
                    BatchProcessor processor = new BatchProcessor(arguments);
                    processor.Run();
                }
                arguments = null;
            }
        }
 public async Task TestSimpleSetup(BatchHandler<object, object> batchHandler, double minimumTimeIntervalMs = 1000, double maximumTimeIntervalMs = -1, int maximumCount = -1, UnprocessedItemAction unprocessedItemAction = UnprocessedItemAction.ReturnDefaultValue)
 {
     //Add an item to the queue, and then wait the minimum amount of time specified on the batch processor and check that our
     //item was processed
     processor = new BatchProcessor<object, object>();
     processor.UnprocessedItemAction = unprocessedItemAction;
     if (!await processor.StartupAsync(
         batchHandler, 
         TimeSpan.FromMilliseconds(minimumTimeIntervalMs), 
         (maximumTimeIntervalMs == -1 ? TimeSpan.MaxValue : TimeSpan.FromMilliseconds(maximumTimeIntervalMs)), 
         maximumCount))
     {
         Assert.Inconclusive("Failed to startup batch processor");
     }
 }
 public void SetUp()
 {
     _repository = new Repository();
     _sut = new BatchProcessor(_repository);
 }