Ejemplo n.º 1
0
        public async Task Initialize()
        {
            _queueManager.NotifyOnError(Console.WriteLine) //I want to know if it works
            .Start();
            _queueManager.AddProcess(new ConsoleWriteProcessable())
            .AddProcess(new ConsoleWriteProcessable())
            .AddProcess(new ConsoleWriteProcessable());

            _queueManager.Stop()
            .AddProcess(new ConsoleWriteProcessable(), 1, "myId")
            .AddProcess(new ConsoleWriteProcessable(), 1)
            .AddProcess(new List <IProcessable> {
                new ConsoleWriteProcessable()
            })
            .AddProcess(new BreakingProcessable())
            .AddProcess(new ConsoleWriteProcessable("process after breaking"));

            await Task.Delay(3000);

            _queueManager.UseListQueue()
            .Start();


            Console.ReadKey();
            _queueManager.AddProcess(new ConsoleWriteProcessable())
            .AddProcess(new BreakingProcessable());
            Console.ReadKey();
        }
Ejemplo n.º 2
0
        private async Task ExecuteQueue()
        {
            _queueManager.AddProcess(new ConsoleWriteProcessable());
            _queueManager.AddProcess(new ConsoleWriteProcessable());
            await Task.Delay(1000);

            _count++;
        }