public WaitForWaitBlockToFinish(ConsoleWriterQueue consoleWriterQueue, WaitBlock waitBlock)
 {
     _consoleWriterQueue = consoleWriterQueue;
     _waitBlock          = waitBlock;
 }
        public static ApplicationConfiguration WithWaitBlock(this ApplicationConfiguration application, WaitBlock waitBlock, ConsoleWriterQueue queue = null)
        {
            if (application == null)
            {
                throw new ArgumentNullException(nameof(application));
            }

            return(application
                   .WithConsoleWriterQueue(queue ?? new ConsoleWriterQueue())
                   .Services(services => services
                             .Advanced(advanced => advanced
                                       .Register <IWaitForShutdownRequest, WaitForWaitBlockToFinish>()
                                       .Register(kernel => waitBlock))));
        }