static void OnCapitalizeReq(CapitalizeReq req) { var resp = new CapitalizeResp(); resp.SessionHandle = req.SessionHandle; resp.Result = req.Message.ToUpper(); Flow.PostAway(resp); }
static void Main(string[] args) { Hub.Get() .Attach(new CapitalizerFlow()) .Attach(new OutputFlow()); Flow.StartAll(); while (true) { string message = Console.ReadLine(); if (message == "quit") { break; } var e = new CapitalizeReq(); e.Message = message; Hub.Get().Post(e); } Flow.StopAll(); }
static void Main(string[] args) { x2.Log.Handler = (level, message) => { Console.WriteLine("[x2] {0}", message); }; x2.Log.Level = x2.LogLevel.All; Hub.Get() .Attach(new OutputFlow().Add(new CapitalizerClient())); Flow.StartAll(); while (true) { string message = Console.ReadLine(); if (message == "quit") { break; } var e = new CapitalizeReq { Message = message }; Hub.Get().Post(e); } Flow.StopAll(); }