本文整理汇总了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);
}
});
}
示例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);
}
}
}
});
}
示例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;
}
示例4: AddSession
public Guid AddSession(IReceiver receiver, IAnalysis analysis)
{
var newSession = new Session(receiver, analysis);
Sessions.Add(newSession);
return newSession.Id;
}
示例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;
}
示例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>();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
}
示例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();
}
示例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();
}
示例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;
}
示例14: Setup
public void Setup()
{
Helper.SetupTestMessagingWithoutPurging();
MessagingSystem.Events.AddEventHook<ConsoleEventHook>();
_receiver = MessagingSystem.Receiver();
senderNode = MessagingSystem.Sender();
}
示例15: Disconnect
public void Disconnect()
{
_sender = null;
_receiver = null;
_link.Close();
_link = null;
_connected = false;
}