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; })); }
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(); } }
public static BaseActor Add(BaseActor anActor, object aMessage) { CheckArg.Actor(anActor); anActor.SendMessage(aMessage); return(anActor); }
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)); }
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)); }
public static void SendMessage <T1, T2>(this BaseActor anActor, T1 t1, T2 t2) { CheckArg.Actor(anActor); anActor.SendMessage(new MessageParam <T1, T2>(t1, t2)); }
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))); }
public void LinkToActor(BaseActor anActor) { LinkedActor = anActor; }