public static void Main(string[] args) { //FileStubHandler handler = new FileStubHandler(false); QueueHandler handler = new QueueHandler(); handler.Start(); Console.ReadKey(); handler.Stop(); }
private void ExecuteHandler(Action <object, CancellationToken> messageHandler, bool multiThreadedHandler) { using (var cut = new QueueHandler(NullLogger.Instance, _queueFactory, _taskFactory)) { cut.Start("MyQueue", true, LocaleQueueMode.TemporaryMaster, true, messageHandler, null, null, 100, multiThreadedHandler, false, _cancellationToken); // ReSharper disable once AccessToDisposedClosure TimerUtility.WaitForIt(() => cut.Idle, 6000); } }
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(); } }