Esempio n. 1
0
 public QueueHandlerUsingMpsc(IHandle <Message> consumer,
                              string name,
                              QueueStatsManager queueStatsManager,
                              bool watchSlowMsg              = true,
                              TimeSpan?slowMsgThreshold      = null,
                              TimeSpan?threadStopWaitTimeout = null,
                              string groupName = null)
     : base(
         consumer, name, queueStatsManager, watchSlowMsg, slowMsgThreshold, threadStopWaitTimeout ?? DefaultStopWaitTimeout,
         groupName)
 {
 }
Esempio n. 2
0
 public static IQueuedHandler CreateQueuedHandler(IHandle <Message> consumer, string name,
                                                  QueueStatsManager queueStatsManager,
                                                  bool watchSlowMsg         = true,
                                                  TimeSpan?slowMsgThreshold = null, TimeSpan?threadStopWaitTimeout = null, string groupName = null)
 {
     //if (IntPtr.Size == 8)
     //{
     //    // optimized path, using much faster multi producer single consumer queue
     //    return new QueueHandlerUsingMpsc(consumer, name, watchSlowMsg, slowMsgThreshold, threadStopWaitTimeout,
     //        groupName);
     //}
     return(new QueuedHandler(consumer, name, queueStatsManager, watchSlowMsg, slowMsgThreshold, threadStopWaitTimeout, groupName));
 }
Esempio n. 3
0
        public QueuedHandlerPulse(IHandle <Message> consumer,
                                  string name,
                                  QueueStatsManager queueStatsManager,
                                  bool watchSlowMsg              = true,
                                  TimeSpan?slowMsgThreshold      = null,
                                  TimeSpan?threadStopWaitTimeout = null,
                                  string groupName = null)
        {
            Ensure.NotNull(consumer, "consumer");
            Ensure.NotNull(name, "name");

            _consumer              = consumer;
            _watchSlowMsg          = watchSlowMsg;
            _slowMsgThreshold      = slowMsgThreshold ?? InMemoryBus.DefaultSlowMessageThreshold;
            _threadStopWaitTimeout = threadStopWaitTimeout ?? QueuedHandler.DefaultStopWaitTimeout;

            _queueMonitor = QueueMonitor.Default;
            _queueStats   = queueStatsManager.CreateQueueStatsCollector(name, groupName);
        }