static void ProcessingQueue()
 {
     while (Interlocked.Read(ref finalizar) == 0L)
     {
         Console.WriteLine("Starting Processing");
         GestorColasAzure gestorEmails = new GestorColasAzure(TipoNotificacion.emails.ToString());
         while (gestorEmails.TieneElementosEnCola())
         {
             Console.WriteLine("Processing emails notifications");
             gestorEmails.ProcesaMensajes();
         }
         GestorColasAzure gestorSms = new GestorColasAzure(TipoNotificacion.sms.ToString());
         while (gestorSms.TieneElementosEnCola())
         {
             Console.WriteLine("Processing sms notifications");
             gestorSms.ProcesaMensajes();
         }
         GestorColasAzure gestorLogs = new GestorColasAzure(TipoNotificacion.logs.ToString());
         while (gestorLogs.TieneElementosEnCola())
         {
             Console.WriteLine("Processing logs");
             gestorLogs.ProcesaMensajes();
         }
         Console.WriteLine("Waiting for signal");
         autoReset.WaitOne();
     }
 }
예제 #2
0
        public void Agregar(Notificacion notificacion)
        {
            GestorColasAzure gestor = new GestorColasAzure(notificacion.Tipo.ToString());

            gestor.Agregar(notificacion);
            QueueThread.Run();
        }
예제 #3
0
        public void Agregar(List <Notificacion> notificaciones)
        {
            GestorColasAzure gestor;

            foreach (var n in notificaciones.GroupBy(x => x.Tipo))
            {
                gestor = new GestorColasAzure(n.Key.ToString());
                gestor.Agregar(n.ToList());
            }
            QueueThread.Run();
        }