예제 #1
0
        public void Start()
        {
            var notifier = new CustomerUpdateNotifier();
            var surnames = new[] { "Crankshaw", "Hickinbotham", "Shufflebottom", "Glasscock", "Haggard" }; 
            var random = new Random();

            while (true)
            {
                int randomIndex = random.Next(0, surnames.Length - 1);
                string randomNewSurname = surnames[randomIndex];
                int randomCustomerId = random.Next(1, 5);

                var customerNameUpdated = new CustomerSurnameUpdatedEvent
                                              {
                                                  Id = randomCustomerId,
                                                  NewSurname = randomNewSurname  
                                              };

                notifier.Publish(customerNameUpdated);
                Thread.Sleep(5000);
            }
        }
예제 #2
0
 public void Publish(CustomerSurnameUpdatedEvent customerSurnameUpdated)
 {
     Clients.All.subscribeTo(customerSurnameUpdated);
 }
예제 #3
0
 internal void Publish(CustomerSurnameUpdatedEvent customerSurnameUpdated)
 {
     // TODO: Error handling
     _hubProxy.Invoke<CustomerSurnameUpdatedEvent>("Publish", customerSurnameUpdated);
 }