public static void Main(string[] args) { //FileStubHandler handler = new FileStubHandler(false); QueueHandler handler = new QueueHandler(); handler.Start(); Console.ReadKey(); handler.Stop(); }
public void CanRestartHandler() { using (var cut = new QueueHandler(NullLogger.Instance, _queueFactory, _taskFactory)) { cut.Start("MyQueue", true, LocaleQueueMode.TemporaryMaster, true, (m, c) => { c.WaitHandle.WaitOne(2000); }, null, null, 100, true, false, _cancellationToken); // ReSharper disable once AccessToDisposedClosure TimerUtility.WaitForIt(() => cut.Idle, 6000); cut.Stop(); cut.Start("MyQueue", true, LocaleQueueMode.TemporaryMaster, true, (m, c) => { c.WaitHandle.WaitOne(2000); }, null, null, 100, true, false, _cancellationToken); // ReSharper disable once AccessToDisposedClosure TimerUtility.WaitForIt(() => cut.Idle, 6000); cut.Stop(); } }