static async void TrySendRpc() { try { var res = await PitayaCluster.Rpc <NPitaya.Protos.RPCRes>(Route.FromString("csharp.testRemote.remote"), null); Console.WriteLine($"Code: {res.Code}"); Console.WriteLine($"Msg: {res.Msg}"); } catch (PitayaException e) { Logger.Error("Error sending RPC Call: {0}", e.Message); } }
private Task SendRequestToFront(string route, bool includeData) { var sessionProto = new Protos.Session { Id = _id, Uid = Uid }; if (includeData) { sessionProto.Data = ByteString.CopyFromUtf8(_rawData); } Console.WriteLine($"sending {sessionProto}"); return(PitayaCluster.Rpc <Response>(_frontendId, Route.FromString(route), sessionProto.ToByteArray())); }
private void SendRpcButtonClicked() { var msg = new Protos.RPCMsg { Msg = inputRPC.text }; try { // var res = PitayaCluster.Rpc<Protos.RPCRes>(Route.FromString("csharp.testremote.remote"), msg); var res = PitayaCluster.Rpc <Protos.RPCRes>(Route.FromString("room.room.test"), msg).Result; Debug.Log($"received rpc res: {res.Msg}"); } catch (Exception e) { Debug.Log(e.Message); } }
static async void TrySendRpc() { Logger.Info("Sending RPC...."); try { var res = await PitayaCluster.Rpc<NPitaya.Protos.MyResponse>( Route.FromString("csharp.testRemote.remote"), new NPitaya.Protos.RPCMsg { Route = "random.route.man", Msg = "HEY", } ); Console.WriteLine("GOT MESSAGE!!!"); Console.WriteLine($"Code: {res.Code}"); Console.WriteLine($"Msg: {res.Msg}"); PitayaCluster.ObserveHistogram("my_histogram", 3, new []{"its_value"}); } catch (PitayaException e) { Logger.Error("Error sending RPC Call: {0}", e.Message); } }