Ejemplo n.º 1
0
            public Task Handle(MyMessage message)
            {
                message.IsHandled = true;

                _receivedMessages.Enqueue(message);

                _waitBlock.Release();

                return(Task.FromResult(true));
            }
            public void Handle(HostArguments args)
            {
                _consoleWriterQueue.Enqueue("Host.Handling");

                if (!_shouldHandleAsWindowsService)
                {
                    _consoleWriterQueue.Enqueue("Host.ManuallyRelease");
                    _waitBlock.Release();
                }

                _shutdown.WaitForShutdown();

                _consoleWriterQueue.Enqueue("Host.Handled");
            }
Ejemplo n.º 3
0
            public void MarkAsHandled()
            {
                Interlocked.Increment(ref _handledCount);

                _waitBlock.Release();
            }