Example #1
0
        private void OnTimedEvent(object sender, ElapsedEventArgs e)
        {
            int counter = 0;

            //_hubContext.Clients.All.SendAsync(Messages.RECEIVE, "yeh?", "yesh?");
            foreach (var message in _messagesRepository.GetMessagesEnumerable())
            {
                if (message == null)
                {
                    continue;
                }
                if (counter > 100)
                {
                    break;
                }
                _hubContext.Clients.All.SendAsync(Messages.RECEIVE, message.Type, message.ObjectAsJObject.ToString());
                counter++;
            }
        }