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


C# IReceiver类代码示例

本文整理汇总了C#中IReceiver的典型用法代码示例。如果您正苦于以下问题:C# IReceiver类的具体用法?C# IReceiver怎么用?C# IReceiver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Session

        public Session(IReceiver receiver, IAnalysis analysis)
        {
            Id = Guid.NewGuid();
            Receiver = receiver;

            DiagnoseOutputEntries = new ReactiveCollection<IDiagnoseOutputEntry>();
            Analysis = new ReactiveCollection<IAnalysis>();

            Analysis.ItemsAdded.Subscribe(x =>
                {
                    foreach (var diagnoseOutputEntry in DiagnoseOutputEntries)
                    {
                        x.ProcessNewDiagnoseOutputEntry(diagnoseOutputEntry);
                    }
                });

            Analysis.Add(analysis);

            DiagnoseOutputEntries.ItemsAdded.Subscribe(x =>
                {
                    foreach (var analyse in Analysis)
                    {
                        analyse.ProcessNewDiagnoseOutputEntry(x);
                    }
                });
        }
开发者ID:GraphalyzerPro,项目名称:GraphalyzerPro,代码行数:26,代码来源:Session.cs

示例2: StartReceiving

 public void StartReceiving(IReceiver receiver, ILogger logger)
 {
     Scheduler.Start(() =>
     {
         int exceptionCount = 0;
         var receivingState = ReceivingState.CanContinueReceiving;
         while (receivingState == ReceivingState.CanContinueReceiving)
         {
             try
             {
                 receivingState = Channel.Receive(receiver);
                 exceptionCount = 0;
             }
             catch (Exception ex)
             {
                 logger.InfoMessage(new ReceiveFailed { ChannelKey = Key, Exception = ex });
                 logger.Error("Error in receive loop", ex);
                 if (++exceptionCount > 9)
                 {
                     // We're probably stuck getting the same error forever, let the process crash.
                     throw new ReceiveFailureException(
                         "Received repeated errors while listening for messages on channel: " + Key,
                         ex);
                 }
             }
         }
     });
 }
开发者ID:kingreatwill,项目名称:fubumvc,代码行数:28,代码来源:ChannelNode.cs

示例3: Command

        static Invoker VoiceCall, VideoCall, Chat; //Add more commands here

        #endregion Fields

        #region Constructors

        public Command(IReceiver receiver, CommandType type)
        {
            VoiceCall = receiver.MakeAVoiceCall;
            VideoCall = receiver.MakeAVideoCall;
            Chat = receiver.StartChat;
            SendFile = receiver.SendFile;
            Type = type;
        }
开发者ID:radtek,项目名称:rrcomssys-team-5,代码行数:14,代码来源:CommandPattern.cs

示例4: AddSession

        public Guid AddSession(IReceiver receiver, IAnalysis analysis)
        {
            var newSession = new Session(receiver, analysis);

            Sessions.Add(newSession);

            return newSession.Id;
        }
开发者ID:GraphalyzerPro,项目名称:GraphalyzerPro,代码行数:8,代码来源:InformationEngine.cs

示例5: ReceiveDataHandler

 public ReceiveDataHandler(Topic t, Participant part, IReceiver receiver)
 {
     topic = t;
     bytes = new byte[t.GetSampleMaxSize()];
     headerBytes = new byte[FRAGMENT_HEADER_SIZE];
     participant = part;
     fragmentSize = Globals.MAX_SEGMENT_SIZE;
     this.receiver = receiver;
 }
开发者ID:staxgr,项目名称:ops,代码行数:9,代码来源:ReceiveDataHandler.cs

示例6: SetUp

		public void SetUp()
		{
			Helper.SetupTestMessaging();
			mock_event_hook = Substitute.For<IEventHook>();

			ObjectFactory.Configure(map=> map.For<IEventHook>().Use(mock_event_hook));

			node_factory = ObjectFactory.GetInstance<IReceiver>();
		}
开发者ID:i-e-b,项目名称:SevenDigital.Messaging,代码行数:9,代码来源:FailingHandlerEventHookTests.cs

示例7: AddReceiver

 private void AddReceiver(IReceiver receiver)
 {
   string displayName = String.IsNullOrEmpty(receiver.DisplayName)
                            ? ReceiverUtils.GetTypeDescription(receiver.GetType())
                            : receiver.DisplayName;
   ListViewItem lvi = receiversListView.Items.Add(displayName);
   lvi.Tag = receiver;
   lvi.Selected = true;
 }
开发者ID:TanyaTPG,项目名称:Log2Console,代码行数:9,代码来源:ReceiversForm.cs

示例8: Receive

 public ReceivingState Receive(IReceiver receiver)
 {
     var stream = _queueManager.ReceiveStream(_queueName);
     foreach (var message in stream.TakeWhile(message => !_disposed))
     {
         receiver.Receive(message.Message.Data, new NameValueHeaders(message.Message.Headers),
             new TransactionCallback(message.TransactionalScope, message.Message, _delayedMessages));
     }
     return ReceivingState.StopReceiving;
 }
开发者ID:joemcbride,项目名称:fubumvc,代码行数:10,代码来源:LightningQueuesChannel.cs

示例9: SetUp

        protected override void SetUp()
        {
            var fiber = new StubFiber();

            _mock_first = CreateMock<IReceiver<int>>();
            _mock_rest = CreateMock<IReceiver<int>>();

            _receiver = new FirstReceiver<int>(fiber,
                _mock_first.Object, _mock_rest.Object);
        }
开发者ID:GWBasic,项目名称:retlang,代码行数:10,代码来源:FirstReceiverFixture.cs

示例10: CreateCommand

 public override Command CreateCommand(ConsoleKeyInfo keyInfo, IReceiver receiver)
 {
     switch (keyInfo.Key)
     {
         case ConsoleKey.Enter:
             return new SubmitCommand(receiver);
         case ConsoleKey.Backspace:
             return new BackspaceCommand(receiver);
         default:
             return new InputCharacterCommand(keyInfo.KeyChar, receiver);
     }
 }
开发者ID:jagmeet-chaudhary,项目名称:ChatApp,代码行数:12,代码来源:Command.cs

示例11: ChatConsoleActor

        public ChatConsoleActor(string userName,string clientActorPath)
        {
            _userName = userName;
            _clientActorPath = clientActorPath;

            _clientActor = ActorSystemContainer.Instance.System.ActorSelection(_clientActorPath).ResolveOne(new TimeSpan(0, 0, 10)).Result;
            _clientActor.Tell(new Messages.AttachConsole(Self));
            Dictionary<string, object> parameters = new Dictionary<string, object>() { { "actor", _clientActor }, { "userName", _userName } };
            //Dictionary<string, object> parameters = new Dictionary<string, object>() { { "filePath", @"c:\logs\fileoutput.txt" } };
            _receiver = GlobalIocContainer.Container.IocContainer.Resolve<IReceiver>(parameters);
            _commandFactory = GlobalIocContainer.Container.IocContainer.Resolve<CommandFactory>();
            _commandManager = new CommandManager();
        }
开发者ID:jagmeet-chaudhary,项目名称:ChatApp,代码行数:13,代码来源:ChatConsoleActor.cs

示例12: MessageBroker

        public MessageBroker(IChannel channel, IWorker worker, IReceiver[] receivers, Configuration.HostSection config)
        {
            this.channel = channel;
            this.worker = worker;
            this.receivers = receivers.ToLookup(r => r.MessageType);

            this.Name = config.Messaging.SenderName;
            this.Enabled = config.Messaging.Enabled;
            this.Async = config.Messaging.Async;
            this.OnlyFromMachineNamed = config.Messaging.Targets.OnlyFromMachineNamed;
            this.SharedSecret = config.Messaging.Targets.SharedSecret;
            this.Targets = config.Messaging.Targets.AllElements.Select(te => new MessageTarget { Name = te.Name, Address = te.Address, ExceptFromMachineNamed = te.ExceptFromMachineNamed }).ToArray();
        }
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:13,代码来源:MessageBroker.cs

示例13: Receive

        public ReceivingState Receive(IReceiver receiver)
        {
            _disposable = _queueManager.Receive(_queueName).Subscribe(message =>
            {
                Task.Run(() =>
                {
                    receiver.Receive(message.Message.Data, new DictionaryHeaders(message.Message.Headers),
                        new TransactionCallback(message.QueueContext, message.Message));
                });
            });

            return ReceivingState.StopReceiving;
        }
开发者ID:DarthFubuMVC,项目名称:fubumvc,代码行数:13,代码来源:LightningQueuesChannel.cs

示例14: Setup

		public void Setup()
		{
			Helper.SetupTestMessagingWithoutPurging();
			MessagingSystem.Events.AddEventHook<ConsoleEventHook>();
			_receiver = MessagingSystem.Receiver();
			senderNode = MessagingSystem.Sender();
		}
开发者ID:i-e-b,项目名称:SevenDigital.Messaging,代码行数:7,代码来源:QueueDestructionSurvivalTests.cs

示例15: Disconnect

 public void Disconnect()
 {
     _sender = null;
     _receiver = null;
     _link.Close();
     _link = null;
     _connected = false;
 }
开发者ID:KasperSK,项目名称:I4IKN,代码行数:8,代码来源:Transport.cs


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