Пример #1
0
 public void OnLoad()
 {
     for (int i = 0; i < 5; i++)
     {
         string payload = "Sample Message " + i;
         DistributableMessage message = new DistributableMessage(payload);
         _aggregator.PublishTimelyBuffered(message, DateTime.Now + new TimeSpan(0, 0, 1, 0));
     }
 }
Пример #2
0
 public void OnLoad()
 {
     for (int i = 0; i < 5; i++)
     {
         string payload = "Sample Message " + i;
         DistributableMessage message = new DistributableMessage(payload);
         _aggregator.Publish(message);
     }
 }
Пример #3
0
 private void CallBack(DistributableMessage obj)
 {
     ++_counter;
     if (_counter >= 5)
     {
         using (StreamWriter text = _fileInfo.CreateText())
         {
             text.WriteLine(_counter);
             text.Close();
         }
     }
 }
Пример #4
0
 private static void CallBack(DistributableMessage obj)
 {
     string myName = Assembly.GetExecutingAssembly().GetName().Name;
     DistributedMessageRegistry.Add(myName);
     Console.WriteLine("Added message '{0}' to the registry",myName);
 }