Esempio n. 1
0
 public static async Task <Object> Receive <T1, T2, T3, T4>(this BaseActor anActor, Func <T1, T2, T3, T4, bool> aPattern)
 {
     CheckArg.Actor(anActor);
     return(await anActor.Receive((o) =>
     {
         IMessageParam <T1, T2, T3, T4> t = o as IMessageParam <T1, T2, T3, T4>;
         return t != null ? aPattern(t.Item1, t.Item2, t.Item3, t.Item4) : false;
     }));
 }
Esempio n. 2
0
        public static void CompleteInitialize(BaseActor anActor)
        {
            CheckArg.Actor(anActor);
            anActor.fListBehaviors = new List <IBehavior>();
            anActor.fCompletions   = QueueFactory <IBehavior> .Current.GetQueue();

            anActor.fMailBox = new ActorMailBox <object>();
            if (anActor.Tag == null)
            {
                anActor.Tag = new ActorTag();
            }
        }
Esempio n. 3
0
 public static BaseActor Add(BaseActor anActor, object aMessage)
 {
     CheckArg.Actor(anActor);
     anActor.SendMessage(aMessage);
     return(anActor);
 }
Esempio n. 4
0
 public static Task <object> Receive <T1, T2, T3, T4>(this BaseActor anActor, Func <T1, T2, T3, T4, bool> aPattern)
 {
     CheckArg.Actor(anActor);
     return(anActor.Receive((o) => o is IMessageParam <T1, T2, T3, T4> t ? aPattern(t.Item1, t.Item2, t.Item3, t.Item4) : false));
 }
Esempio n. 5
0
 public static void SendMessage <T1, T2, T3, T4>(this BaseActor anActor, T1 t1, T2 t2, T3 t3, T4 t4)
 {
     CheckArg.Actor(anActor);
     anActor.SendMessage(new MessageParam <T1, T2, T3, T4>(t1, t2, t3, t4));
 }
Esempio n. 6
0
 public static void SendMessage <T1, T2>(this BaseActor anActor, T1 t1, T2 t2)
 {
     CheckArg.Actor(anActor);
     anActor.SendMessage(new MessageParam <T1, T2>(t1, t2));
 }
Esempio n. 7
0
 public static Task <object> ReceiveAsync <T1, T2, T3>(this BaseActor anActor, Func <T1, T2, T3, bool> aPattern)
 {
     CheckArg.Actor(anActor);
     return(anActor.ReceiveAsync((o) => o is IMessageParam <T1, T2, T3> t && aPattern(t.Item1, t.Item2, t.Item3)));
 }
Esempio n. 8
0
 public void LinkToActor(BaseActor anActor)
 {
     LinkedActor = anActor;
 }