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


C# Pipe.Send方法代码示例

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


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

示例1: Bind

        public void Bind(Pipe pipe)
        {
            base.Visit(pipe);

            if (!_bound)
                throw new PipelineException("Could not bind pipe: " + _segment.SegmentType + "(" + _segment.MessageType + ")");

            pipe.Send(new SubscriberAdded {MessageType = _messageType});
        }
开发者ID:daffers,项目名称:Magnum,代码行数:9,代码来源:SubscriberBinder.cs

示例2: SendMessage

 /// <summary>
 /// Send Message
 /// </summary>
 private void SendMessage()
 {
     // We get here if Completed() is called for the first time. 
     // Need to send special message to DeleteProjectCleanup worker.
     var pipelineSection = FindPipelineSection("DeleteProjectCleanup");
     var dataPipeName = pipelineSection.DataPipeName;
     using (var dataPipe = new Pipe(dataPipeName))
     {
         dataPipe.Open();
         var envelope = new PipeMessageEnvelope() { Label = "PleaseCleanup" };
         dataPipe.Send(envelope);
     }
     _finalizationRequested = true;
 }
开发者ID:Rajeshbharathi,项目名称:CGN.Paralegal,代码行数:17,代码来源:DeleteProjectPipeline.cs

示例3: How_many_messages_can_the_pipe_send_per_second

        public void How_many_messages_can_the_pipe_send_per_second()
        {
            _count = 0;
            _count2 = 0;
            _limit = 5000000;

            Pipe consumer = PipeSegment.Consumer<ClaimModified>(m => { Interlocked.Increment(ref _count); });
            Pipe consumer2 = PipeSegment.Consumer<ClaimModified>(m => { Interlocked.Increment(ref _count2); });

            var recipients = new[] {consumer, consumer2};

            Pipe recipientList = PipeSegment.RecipientList<ClaimModified>(recipients);
            Pipe filter = PipeSegment.Filter<object>(recipientList);
            Pipe objectRecipientList = PipeSegment.RecipientList<object>(new[] {filter});
            _input = PipeSegment.Input(objectRecipientList);

            var message = new ClaimModified();

            for (int i = 0; i < 100; i++)
            {
                _input.Send(message);
            }

            _count = 0;
            _count2 = 0;

            Thread pusherThread = new Thread(Pusher);
            Thread pusherThread2 = new Thread(Pusher);

            Stopwatch timer = Stopwatch.StartNew();

            pusherThread.Start();
            pusherThread2.Start();

            pusherThread.Join(10000);
            pusherThread2.Join(1000);

            timer.Stop();

            Trace.WriteLine("Received: " + (_count + _count2) + ", expected " + _limit*2);
            Trace.WriteLine("Elapsed Time: " + timer.ElapsedMilliseconds + "ms");
            Trace.WriteLine("Messages Per Second: " + _limit*1000/timer.ElapsedMilliseconds);
        }
开发者ID:KevM,项目名称:Magnum,代码行数:43,代码来源:Throughput_Specs.cs

示例4: AddPipe

		public void AddPipe(Pipe pipe)
		{
			Pipes.Add (pipe);
			pipe.Send (Exchange.Handshake (0x1a));
		}
开发者ID:lukedoolittle,项目名称:telehash.net,代码行数:5,代码来源:Link.cs

示例5: First_example

        public void First_example()
        {
            _eventAggregator = PipeSegment.Input(PipeSegment.End());

            _eventAggregator.Send(new CustomerRatingDowngraded());
        }
开发者ID:daffers,项目名称:Magnum,代码行数:6,代码来源:Examples.cs


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