Exemplo n.º 1
0
 public void Handle(DeadLetter deadLetter)
 {
     if (!actor.IsStopped)
     {
         Action <IDeadLettersListener> consumer = actor => actor.Handle(deadLetter);
         mailbox.Send(new LocalMessage <IDeadLettersListener>(actor, consumer, "Handle(DeadLetter)"));
     }
     else
     {
         actor.DeadLetters.FailedDelivery(new DeadLetter(actor, "Handle(DeadLetter)"));
     }
 }
Exemplo n.º 2
0
        private void DeadLetter()
        {
            var deadLetter  = new DeadLetter(actor, representation);
            var deadLetters = actor.DeadLetters;

            if (deadLetters != null)
            {
                deadLetters.FailedDelivery(deadLetter);
            }
            else
            {
                actor.Logger.Warn($"vlingo-dotnet/actors: MISSING DEAD LETTERS FOR: {deadLetter}");
            }
        }
Exemplo n.º 3
0
        public void FailedDelivery(DeadLetter deadLetter)
        {
            Logger.Debug(deadLetter.ToString());

            foreach (var listener in listeners)
            {
                try
                {
                    listener.Handle(deadLetter);
                }
                catch (Exception ex)
                {
                    // ignore, but log
                    Logger.Warn($"DeadLetters listener failed to handle: {deadLetter}", ex);
                }
            }
        }
Exemplo n.º 4
0
        public void FailedDelivery(DeadLetter deadLetter)
        {
            Logger.Log($"vlingo-dotnet/actors: {deadLetter}");

            foreach (var listener in listeners)
            {
                try
                {
                    listener.Handle(deadLetter);
                }
                catch (Exception ex)
                {
                    // ignore, but log
                    Logger.Log($"DeadLetters listener failed to handle: {deadLetter}", ex);
                }
            }
        }
Exemplo n.º 5
0
 public void Handle(DeadLetter deadLetter)
 {
     if (!actor.IsStopped)
     {
         Action <IDeadLettersListener> consumer = x => x.Handle(deadLetter);
         if (mailbox.IsPreallocated)
         {
             mailbox.Send(actor, consumer, null, "Handle(DeadLetter)");
         }
         else
         {
             mailbox.Send(new LocalMessage <IDeadLettersListener>(actor, consumer, "Handle(DeadLetter)"));
         }
     }
     else
     {
         actor.DeadLetters.FailedDelivery(new DeadLetter(actor, "Handle(DeadLetter)"));
     }
 }
 public void FailedDelivery(DeadLetter deadLetter)
 {
     if (!_actor.IsStopped)
     {
         Action <IDeadLetters> consumer = x => x.FailedDelivery(deadLetter);
         if (_mailbox.IsPreallocated)
         {
             _mailbox.Send(_actor, consumer, null, "FailedDelivery(DeadLetter)");
         }
         else
         {
             _mailbox.Send(new LocalMessage <IDeadLetters>(_actor, consumer, "FailedDelivery(DeadLetter)"));
         }
     }
     else
     {
         _actor.DeadLetters?.FailedDelivery(new DeadLetter(_actor, "FailedDelivery(DeadLetter)"));
     }
 }