public void Publish(Message message)
        {
            //Ensure.NotNull(message, "message");
#if DEBUG
            _queueStats.Enqueued();
#endif
            _queue.Enqueue(message);
            if (!_stop && Interlocked.CompareExchange(ref _isRunning, 1, 0) == 0)
            {
                ThreadPool.QueueUserWorkItem(ReadFromQueue);
            }
        }
Пример #2
0
        public void Publish(Message message)
        {
            //Ensure.NotNull(message, "message");
#if DEBUG
            _queueStats.Enqueued();
#endif
            _queue.Enqueue(message);
            if (_starving)
            {
                _msgAddEvent.Set();
            }
        }
Пример #3
0
        public void Publish(Message message)
        {
            //Ensure.NotNull(message, "message");
#if DEBUG
            _queueStats.Enqueued();
#endif
            _queue.Enqueue(message);
            if (_starving)
            {
                lock (_locker) {
                    Monitor.Pulse(_locker);
                }
            }
        }