public static void Tell(this IModulePipeline pipeline, Newtonsoft.Json.Linq.JToken json) { if (pipeline.IsLocal) { pipeline.TellLocalObj(json); } else { pipeline.Tell(Pack(json).ToArray()); } }
public static void Tell(this IModulePipeline pipeline, MessagePackObject?obj) { if (pipeline.IsLocal) { pipeline.TellLocalObj(obj); } else { pipeline.Tell(Pack(obj).ToArray()); } }
public override void OnTellLocalObj(IModulePipeline from, object obj) { switch (obj) { case Send1 s1: Console.WriteLine("hello got send1=" + s1.str1); refhello2.TellLocalObj(new Send2()); break; case Send2 s2: Console.WriteLine("hello2 got send2=" + s2.int1 + "," + s2.int2); break; default: Console.WriteLine("unknown obj."); break; } }
public override void OnStart() { this.refhello2 = this.GetPipeline("this/hello2"); refhello2.TellLocalObj(new Send2()); }