// See https://aka.ms/new-console-template for more information

using Quadarax.Foundation.Core.Business.Processor.Providers;
using Quadarax.Foundation.Core.Business.Processor.Queue;
using Quadarax.Foundation.Core.Business.Processor.Task.ExecuteProvider;
using Quadarax.Foundation.Core.Data;
using Quadarax.Foundation.Core.Object;

Console.WriteLine("Processor test bench ...");

using (var processor = new ProcessQueue("TEST", new InMemoryStorageProvider(), new ProcessQueueConfiguration(3, TimeSpan.FromSeconds(5))))
{

    for (int i = 0; i < 10; i++)
    {
        var item = processor.CreateTask($"task{i:D2}",
            typeof(DummyExecuteProvider).AssemblyQualifiedName, DummyExecuteProvider.CreateDefaultArguments(),
            5,
            5,
            TimeSpan.FromSeconds(5),
            DateTime.Now.AddSeconds(5),
            DateTime.Now.AddHours(1));
    }

    processor.Start();
    Console.WriteLine("Processor started ...");
    Console.WriteLine("Press any key to stop ...");
    Console.ReadKey();
    processor.Stop();
    Console.WriteLine("Processor stopped ...");
}



