本文整理汇总了C#中IMessageReceiver类的典型用法代码示例。如果您正苦于以下问题:C# IMessageReceiver类的具体用法?C# IMessageReceiver怎么用?C# IMessageReceiver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMessageReceiver类属于命名空间,在下文中一共展示了IMessageReceiver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MessageProcessor
/// <summary>
/// Parameterized Constructor.
/// </summary>
public MessageProcessor(IMessageReceiver receiver,
IMessageExecutor executor)
{
this.receiver = receiver;
this.executor = executor;
this.broker = MessageBrokerFactory.Instance.GetOrCreate("message");
}
示例2: removeReciever
public static IMessageReceiver removeReciever(IMessageReceiver group, IMessageReceiver remove)
{
if (group == null)
throw new Exception("Receiver not found!");
if (remove == group)
return null;
else if (group is DoubleReceiver)
{
DoubleReceiver dual = (DoubleReceiver)group;
IMessageReceiver newone = removeReciever(dual.one, remove);
IMessageReceiver newtwo = removeReciever(dual.two, remove);
if (newone != null && newtwo != null)
{
dual.one = newone;
dual.two = newtwo;
return dual;
}
else if (newone != null)
return newone;
else if (newtwo != null)
return newtwo;
else
return null;
}
else
return group;
}
示例3: ServiceBusCollector
public ServiceBusCollector(IMessageReceiver messageReceiver)
{
receiverCancellationTokenSource = new CancellationTokenSource();
receiveWaitTime = TimeSpan.FromMinutes(1);
receiver = messageReceiver;
stopped = new ManualResetEventSlim(false);
}
示例4: addReceiver
public static IMessageReceiver addReceiver(IMessageReceiver group, IMessageReceiver add)
{
if (group == null)
return add;
return new DoubleReceiver(add, group);
}
示例5: CreateBus
public void CreateBus()
{
m_Sender = Substitute.For<IMessageSender>();
m_Receiver = Substitute.For<IMessageReceiver>();
m_Bus = new MessageBus(m_Sender,
m_Receiver);
}
示例6: RemoveReceiver
internal void RemoveReceiver(IMessageReceiver r)
{
lock (inbox)
{
inbox.Remove(r);
}
}
示例7: TriggerNotificationQueueMonitor
/// <param name="instanceId">The unique name of this worker.</param>
/// <param name="messageReceiver">The receiver set up to listen for incoming trigger update notifications.</param>
/// <param name="notificationBuffer">The buffer to which the worker will write all received trigger update notifications.</param>
public TriggerNotificationQueueMonitor(string instanceId, IMessageReceiver messageReceiver, BlockingCollection<TriggerUpdateNotification> notificationBuffer) : base(instanceId, messageReceiver)
{
if (notificationBuffer == null)
throw new ArgumentNullException("notificationBuffer");
_notificationBuffer = notificationBuffer;
}
示例8: Coderack
/// <summary>
/// Create a new coderack
/// </summary>
public Coderack(IMessageReceiver receiver)
{
codelets = new SalienceTree<Codelet>();
isEvaluating = new DescriptorCodelet(this, "evaluating");
isCompleting = new DescriptorCodelet(this, "completing");
watching = false;
this.receiver = receiver;
}
示例9: RegisterReceiver
public static void RegisterReceiver(IMessageReceiver Receiver)
{
if (!Receivers.Contains(Receiver))
{
Receivers.Add(Receiver);
Debug.Log("Added new Message Receiver");
}
}
示例10: TransactionMonitorWorker
public TransactionMonitorWorker(string instanceId, IMessageReceiver messageReceiver, IAuditRepository repository)
: base(instanceId, messageReceiver)
{
if(repository == null)
throw new ArgumentNullException("repository");
_repository = repository;
_deserializer = new TransactionEventConverter();
}
示例11: Initialize
// Add the plugins actions and data source
public InitializeResult Initialize(PluginEnvironment env, Assembly assembly, IMessageReceiver receiver)
{
env.SetDataSource(PartTypeSourceName, new Sentence(new List<KeyValuePair<string, string>>()));
env.AddAction(new StringParseHandler(env));
env.AddAction(new EnumerableParseHandler());
env.AddAction(new ParaphraseHandler(env));
return InitializeResult.Success();
}
示例12: NmqMessageServer
/// <summary>
/// Initializes a new instance of the <see cref="NmqMessageServer"/> class.
/// </summary>
/// <param name="messageReceiver">The message receiver.</param>
/// <param name="port">The port.</param>
internal NmqMessageServer(IMessageReceiver messageReceiver, int port)
{
tokenSource = new CancellationTokenSource();
this.port = port;
this.messageReceiver = messageReceiver;
context = NetMQContext.Create();
responseQueue = new NmqResponseQueue(context, port);
}
示例13: CommandProcessor
public CommandProcessor(
IMessageReceiver messageReceiver,
ICommandRouter commandRouter,
ITextSerializer serializer)
{
_messageReceiver = messageReceiver;
_commandRouter = commandRouter;
_serializer = serializer;
}
示例14: WorkloadQueueMonitor
public WorkloadQueueMonitor(string instanceId, IMessageReceiver messageReceiver, IMessagePublisher statusPublisher, int httpWorkerCount)
: base(instanceId, messageReceiver)
{
if(statusPublisher == null)
throw new ArgumentNullException("statusPublisher");
_batchQueue = new ConcurrentQueue<WorkloadBatchMessage>();
_httpWorkerCount = httpWorkerCount;
_statusPublisher = statusPublisher;
}
示例15: QueueMonitorWorker
protected QueueMonitorWorker(string instanceId, IMessageReceiver messageReceiver)
{
if (instanceId == null)
throw new ArgumentNullException("instanceId");
if (messageReceiver == null)
throw new ArgumentNullException("messageReceiver");
InstanceId = instanceId;
Receiver = messageReceiver;
}