示例#1
0
        private static async Task ThriftHello(RpcContractThrift.IHelloService helloServiceThrift, string helloword = "world")
        {
            Console.WriteLine("ThriftHello---------------------------------------------------------------------------");
            var callNameVoid = await helloServiceThrift.CallNameVoidAsync();

            Console.WriteLine(callNameVoid);
            await helloServiceThrift.CallNameAsync(helloword);

            Console.WriteLine("CallName called");
            await helloServiceThrift.CallVoidAsync();

            Console.WriteLine("CallVoid called");
            var hello = await helloServiceThrift.HelloAsync(helloword);

            Console.WriteLine(hello);
            var helloResult = await helloServiceThrift.SayHelloAsync(helloword + "perfect world");

            Console.WriteLine($"{helloResult.Name},{helloResult.Gender},{helloResult.Head}");
            helloResult.Name = helloword + "show perfect world";
            var showResult = await helloServiceThrift.ShowHelloAsync(helloResult);

            Console.WriteLine(showResult);

            ThriftHelloCall(helloServiceThrift, helloword);
        }
示例#2
0
文件: Program.cs 项目: lulzzz/zooland
        private static void ThriftHello(RpcContractThrift.IHelloService helloServiceThrift, string helloword = "world")
        {
            var token        = CancellationToken.None;
            var callNameVoid = helloServiceThrift.CallNameVoidAsync(token).GetAwaiter().GetResult();

            Console.WriteLine(callNameVoid);
            helloServiceThrift.CallNameAsync(helloword, token).GetAwaiter().GetResult();
            Console.WriteLine("CallName called");
            helloServiceThrift.CallVoidAsync(token).GetAwaiter().GetResult();
            Console.WriteLine("CallVoid called");
            var hello = helloServiceThrift.HelloAsync(helloword, token).GetAwaiter().GetResult();

            Console.WriteLine(hello);
            var helloResult = helloServiceThrift.SayHelloAsync(helloword + "perfect world", token).GetAwaiter().GetResult();

            Console.WriteLine($"{helloResult.Name},{helloResult.Gender},{helloResult.Head}", token);
            helloResult.Name = helloword + "show perfect world";
            var showResult = helloServiceThrift.ShowHelloAsync(helloResult, token).GetAwaiter().GetResult();

            Console.WriteLine(showResult);
        }