Example #1
0
        public QueueProducer Send(string queueName, object message)
        {
            if (string.IsNullOrWhiteSpace(queueName))
            {
                throw new ArgumentNullException("queueName");
            }

            _provider.IgnoreHash = IgnoreHash;
            _provider.Enqueue(queueName, message);

            return(this);
        }
Example #2
0
        private void TimerTick()
        {
            if (_bufferQueue.Count == 0)
            {
                // Stop timer
                _tmrTicker.Change(Timeout.Infinite, Timeout.Infinite);

                try
                {
                    _queueProvider.Enqueue(_bufferQueue);
                }
                catch (Exception exp)
                {
                    LogFactory.Log.Error(exp);
                }
                finally
                {
                    // Resume timer
                    _tmrTicker.Change(_dueTime, _period);
                }
            }
        }