private void RunConsumer(int messageCount, int runtime, int timeOut, int workerCount, int readerCount, int queueSize,
                                 bool useTransactions, int messageType, ITaskFactory factory, bool enableChaos)
        {
            var queue = new SimpleConsumerAsync();

            queue.RunWithFactory(messageCount, runtime, timeOut, workerCount, readerCount, queueSize, useTransactions, messageType, factory, enableChaos);
        }
        public void Run(int messageCount, int runtime, int timeOut, int workerCount, int readerCount, int queueSize,
                        bool useTransactions, bool enableChaos)
        {
            var factory = SimpleConsumerAsync.CreateFactory(workerCount, queueSize, out var schedulerContainer);

            using (schedulerContainer)
            {
                using (factory.Scheduler)
                {
                    var task1 =
                        Task.Factory.StartNew(
                            () =>
                            RunConsumer(messageCount, runtime, timeOut, workerCount, readerCount,
                                        queueSize, useTransactions, 1, factory, enableChaos));

                    var task2 =
                        Task.Factory.StartNew(
                            () =>
                            RunConsumer(messageCount, runtime, timeOut, workerCount, readerCount,
                                        queueSize, useTransactions, 2, factory, enableChaos));

                    var task3 =
                        Task.Factory.StartNew(
                            () =>
                            RunConsumer(messageCount, runtime, timeOut, workerCount, readerCount,
                                        queueSize, useTransactions, 3, factory, enableChaos));

                    Task.WaitAll(task1, task2, task3);
                }
            }
        }
 private async Task RunConsumer(string queueName, int messageCount, int runtime, int timeOut, int workerCount, int readerCount, int queueSize,
                                bool useTransactions, bool enableChaos, string schema, int messageType)
 {
     var consumer = new SimpleConsumerAsync();
     await consumer.Run(messageCount, runtime, timeOut, workerCount, readerCount, queueSize, useTransactions,
                        messageType, enableChaos,
                        schema, queueName).ConfigureAwait(false);
 }
 private void RunConsumer(int messageCount, int runtime, int timeOut, int workerCount, int readerCount, int queueSize,
    bool useTransactions, int messageType, ITaskFactory factory)
 {
     var queue = new SimpleConsumerAsync();
     queue.Run(messageCount, runtime, timeOut, workerCount, readerCount, queueSize, useTransactions, messageType, factory);
 }