Beispiel #1
0
 internal void SendStart(Actor targetActor)
 {
     try
     {
         Action <IStartable> consumer = actor => actor.Start();
         var message = new LocalMessage <IStartable>(targetActor, consumer, "Start()");
         Environment.Mailbox.Send(message);
     }
     catch (Exception ex)
     {
         Environment.Logger.Log("vlingo-dotnet/actors: Actor Start() failed: {ex.Message}");
         Environment.Stage.HandleFailureOf <IStartable>(new StageSupervisedActor <IStartable>(targetActor, ex));
     }
 }
Beispiel #2
0
 internal void SendStart(Actor targetActor)
 {
     try
     {
         Action <IStartable> consumer = x => x.Start();
         if (!Environment.Mailbox.IsPreallocated)
         {
             var message = new LocalMessage <IStartable>(targetActor, consumer, "Start()");
             Environment.Mailbox.Send(message);
         }
         else
         {
             Environment.Mailbox.Send(targetActor, consumer, null, "Start()");
         }
     }
     catch (Exception ex)
     {
         Environment.Logger.Error("vlingo-net/actors: Actor Start() failed: {ex.Message}");
         Environment.Stage.HandleFailureOf(new StageSupervisedActor <IStartable>(targetActor, ex));
     }
 }
 public LocalMessage(LocalMessage <TActor> message)
     : this(message.actor !, message.consumer !, message.completes, message.representation !)
 public StowedLocalMessage(LocalMessage <T> message)
     : base(message)
 {
 }
 public LocalMessage(LocalMessage <T> message)
     : this(message.Actor, message.Consumer, null, message.Representation)
 {
 }