当前位置: 首页>>代码示例>>C#>>正文


C# IMessageContext.OnMessageHandled方法代码示例

本文整理汇总了C#中IMessageContext.OnMessageHandled方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageContext.OnMessageHandled方法的具体用法?C# IMessageContext.OnMessageHandled怎么用?C# IMessageContext.OnMessageHandled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMessageContext的用法示例。


在下文中一共展示了IMessageContext.OnMessageHandled方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Handle

 public void Handle(QueueMessage message, IMessageContext context)
 {
     var count = Interlocked.Increment(ref _handledCount);
     if (count % 1000 == 0)
     {
         Console.WriteLine("Total handled {0} messages.", count);
     }
     context.OnMessageHandled(message);
 }
开发者ID:peidachang,项目名称:equeue,代码行数:9,代码来源:Program.cs

示例2: Handle

            public void Handle(QueueMessage message, IMessageContext context)
            {
                var count = Interlocked.Increment(ref _handledCount);
                if (count == 1)
                {
                    _watch = Stopwatch.StartNew();
                }
                else if (count % 1000 == 0)
                {
                    _logger.InfoFormat("Total handled {0} messages, time spent:{1}", count, _watch.ElapsedMilliseconds);
                }

                context.OnMessageHandled(message);
            }
开发者ID:edgevagrant,项目名称:equeue,代码行数:14,代码来源:Program.cs

示例3: Handle

 public void Handle(QueueMessage message, IMessageContext context)
 {
     Interlocked.Increment(ref _handledCount);
     Thread.Sleep(20);
     context.OnMessageHandled(message);
 }
开发者ID:tangxuehua,项目名称:EQueueSample,代码行数:6,代码来源:Program.cs

示例4: Handle

            public void Handle(QueueMessage message, IMessageContext context)
            {
                var currentCount = Interlocked.Increment(ref _handledCount);
                if (currentCount == 1)
                {
                    _watch = Stopwatch.StartNew();
                }
                if (currentCount % 10000 == 0)
                {
                    _logger.InfoFormat("Total handled {0} messages, timeSpent: {1}ms, throughput: {2}/s", currentCount, _watch.ElapsedMilliseconds, currentCount * 1000 / _watch.ElapsedMilliseconds);
                }

                context.OnMessageHandled(message);
            }
开发者ID:huoxudong125,项目名称:equeue,代码行数:14,代码来源:Program.cs

示例5: Handle

 public void Handle(QueueMessage message, IMessageContext context)
 {
     Interlocked.Increment(ref _handledCount);
     _rtStatisticService.AddRT((DateTime.Now - message.CreatedTime).TotalMilliseconds);
     context.OnMessageHandled(message);
 }
开发者ID:Aaron-Liu,项目名称:equeue,代码行数:6,代码来源:Program.cs

示例6: Handle

            public void Handle(QueueMessage message, IMessageContext context)
            {
                var currentCount = Interlocked.Increment(ref _handledCount);
                if (currentCount == 1)
                {
                    _watch = Stopwatch.StartNew();
                }
                if (currentCount % 10000 == 0)
                {
                    var currentElapsedMilliseconds = _watch.ElapsedMilliseconds;
                    _logger.InfoFormat("Total handled {0} messages, throughput: {1}, latency: {2}ms",
                        currentCount,
                        (currentCount - _previousHandledCount) * 1000 / (currentElapsedMilliseconds - _previousElapsedMilliseconds),
                        (DateTime.Now - message.CreatedTime).TotalMilliseconds);
                    _previousHandledCount = currentCount;
                    _previousElapsedMilliseconds = currentElapsedMilliseconds;
                }

                context.OnMessageHandled(message);
            }
开发者ID:huyuezheng,项目名称:equeue,代码行数:20,代码来源:Program.cs

示例7: typeof

 void IMessageHandler.Handle(QueueMessage message, IMessageContext context)
 {
     _processor._domainEventHandledMessageLocalQueue.Add(_processor._binarySerializer.Deserialize(message.Body, typeof(DomainEventHandledMessage)) as DomainEventHandledMessage);
     context.OnMessageHandled(message);
 }
开发者ID:key-value,项目名称:enode,代码行数:5,代码来源:CommandResultProcessor.cs


注:本文中的IMessageContext.OnMessageHandled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。