Example #1
0
        private void despacharEventosLOA(object sender, HBLivroOfertasAgregadoEventArgs args)
        {
            try
            {
                string mensagem = null;

                EventoHBLivroOfertasAgregado eventoHB = args.Evento;
                mensagem = eventoHB.mensagem;

                if (!String.IsNullOrEmpty(mensagem))
                {
                    bool sinaliza = queueToHomeBroker.IsEmpty;
                    queueToHomeBroker.Enqueue(mensagem);
                    if (sinaliza)
                    {
                        lock (syncObj)
                        {
                            Monitor.Pulse(syncObj);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("despacharEventos(): " + ex.Message, ex);
            }
        }
Example #2
0
        public void SendEvent(EventoHBLivroOfertasAgregado e)
        {
            try
            {
                // bool bsinaliza = queueHBLOA.IsEmpty;
                queueHBLOA.Enqueue(e);

                //if (bsinaliza)
                //{
                //    lock (syncQueueHBLOA)
                //    {
                //        Monitor.Pulse(syncQueueHBLOA);
                //    }
                //}
            }
            catch (Exception ex)
            {
                logger.Error("SendEvent(EventoHBLivroOfertasAgregado): " + ex.Message, ex);
            }
        }