diff options
Diffstat (limited to 'src/csharp/Grpc.Examples')
-rw-r--r-- | src/csharp/Grpc.Examples/MathExamples.cs | 21 | ||||
-rw-r--r-- | src/csharp/Grpc.Examples/MathServiceImpl.cs | 13 | ||||
-rw-r--r-- | src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs | 28 |
3 files changed, 20 insertions, 42 deletions
diff --git a/src/csharp/Grpc.Examples/MathExamples.cs b/src/csharp/Grpc.Examples/MathExamples.cs index 134270f6f7..b8bb7eacbd 100644 --- a/src/csharp/Grpc.Examples/MathExamples.cs +++ b/src/csharp/Grpc.Examples/MathExamples.cs @@ -71,7 +71,8 @@ namespace math public static void SumExample(MathGrpc.IMathServiceClient stub) { List<Num> numbers = new List<Num> - {new Num.Builder { Num_ = 1 }.Build(), + { + new Num.Builder { Num_ = 1 }.Build(), new Num.Builder { Num_ = 2 }.Build(), new Num.Builder { Num_ = 3 }.Build() }; @@ -110,24 +111,12 @@ namespace math public static void DependendRequestsExample(MathGrpc.IMathServiceClient stub) { var numberList = new List<Num> - { new Num.Builder{ Num_ = 1 }.Build(), - new Num.Builder{ Num_ = 2 }.Build(), new Num.Builder{ Num_ = 3 }.Build() + { + new Num.Builder { Num_ = 1 }.Build(), + new Num.Builder { Num_ = 2 }.Build(), new Num.Builder { Num_ = 3 }.Build() }; numberList.ToObservable(); - - //IObserver<Num> numbers; - //Task<Num> call = stub.Sum(out numbers); - //foreach (var num in numberList) - //{ - // numbers.OnNext(num); - //} - //numbers.OnCompleted(); - - //Num sum = call.Result; - - //DivReply result = stub.Div(new DivArgs.Builder { Dividend = sum.Num_, Divisor = numberList.Count }.Build()); } } } - diff --git a/src/csharp/Grpc.Examples/MathServiceImpl.cs b/src/csharp/Grpc.Examples/MathServiceImpl.cs index 76a08ce518..0b2357e0fa 100644 --- a/src/csharp/Grpc.Examples/MathServiceImpl.cs +++ b/src/csharp/Grpc.Examples/MathServiceImpl.cs @@ -73,8 +73,8 @@ namespace math public IObserver<Num> Sum(IObserver<Num> responseObserver) { var recorder = new RecordingObserver<Num>(); - Task.Factory.StartNew(() => { - + Task.Factory.StartNew(() => + { List<Num> inputs = recorder.ToList().Result; long sum = 0; @@ -104,7 +104,7 @@ namespace math static IEnumerable<Num> FibInternal(long n) { long a = 1; - yield return new Num.Builder { Num_=a }.Build(); + yield return new Num.Builder { Num_ = a }.Build(); long b = 1; for (long i = 0; i < n - 1; i++) @@ -112,12 +112,12 @@ namespace math long temp = a; a = b; b = temp + b; - yield return new Num.Builder { Num_=a }.Build(); + yield return new Num.Builder { Num_ = a }.Build(); } } - private class DivObserver : IObserver<DivArgs> { - + private class DivObserver : IObserver<DivArgs> + { readonly IObserver<DivReply> responseObserver; public DivObserver(IObserver<DivReply> responseObserver) @@ -142,4 +142,3 @@ namespace math } } } - diff --git a/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs index 7603db7ffd..b55d24166c 100644 --- a/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs @@ -1,22 +1,12 @@ using System.Reflection; using System.Runtime.CompilerServices; -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. -[assembly: AssemblyTitle ("Grpc.Examples")] -[assembly: AssemblyDescription ("")] -[assembly: AssemblyConfiguration ("")] -[assembly: AssemblyCompany ("")] -[assembly: AssemblyProduct ("")] -[assembly: AssemblyCopyright ("Google Inc. All rights reserved.")] -[assembly: AssemblyTrademark ("")] -[assembly: AssemblyCulture ("")] -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. -[assembly: AssemblyVersion ("0.1.*")] -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] - +[assembly: AssemblyTitle("Grpc.Examples")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Google Inc. All rights reserved.")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyVersion("0.1.*")] |