diff --git a/src/csharp/Grpc.Examples/MathGrpc.cs b/src/csharp/Grpc.Examples/MathGrpc.cs index 2d3034d28b5ff..d700a18778bb7 100644 --- a/src/csharp/Grpc.Examples/MathGrpc.cs +++ b/src/csharp/Grpc.Examples/MathGrpc.cs @@ -151,25 +151,25 @@ public interface IMath /// Div divides args.dividend by args.divisor and returns the quotient and /// remainder. /// - Task Div(global::Math.DivArgs request, ServerCallContext context); + global::System.Threading.Tasks.Task Div(global::Math.DivArgs request, ServerCallContext context); /// /// DivMany accepts an arbitrary number of division args from the client stream /// and sends back the results in the reply stream. The stream continues until /// the client closes its end; the server does the same after sending all the /// replies. The stream ends immediately if either end aborts. /// - Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); /// /// Fib generates numbers in the Fibonacci sequence. If args.limit > 0, Fib /// generates up to limit numbers; otherwise it continues until the call is /// canceled. Unlike Fib above, Fib has no final FibReply. /// - Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context); /// /// Sum sums a stream of numbers, returning the final result once the stream /// is closed. /// - Task Sum(IAsyncStreamReader requestStream, ServerCallContext context); + global::System.Threading.Tasks.Task Sum(IAsyncStreamReader requestStream, ServerCallContext context); } /// Base class for server-side implementations of Math @@ -179,7 +179,7 @@ public abstract class MathBase /// Div divides args.dividend by args.divisor and returns the quotient and /// remainder. /// - public virtual Task Div(global::Math.DivArgs request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Div(global::Math.DivArgs request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -190,7 +190,7 @@ public abstract class MathBase /// the client closes its end; the server does the same after sending all the /// replies. The stream ends immediately if either end aborts. /// - public virtual Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task DivMany(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -200,7 +200,7 @@ public virtual Task DivMany(IAsyncStreamReader requestStre /// generates up to limit numbers; otherwise it continues until the call is /// canceled. Unlike Fib above, Fib has no final FibReply. /// - public virtual Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Fib(global::Math.FibArgs request, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -209,7 +209,7 @@ public virtual Task Fib(global::Math.FibArgs request, IServerStreamWriter - public virtual Task Sum(IAsyncStreamReader requestStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Sum(IAsyncStreamReader requestStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } diff --git a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs index 967d1170bedfc..51c6a39b1d8fa 100644 --- a/src/csharp/Grpc.HealthCheck/HealthGrpc.cs +++ b/src/csharp/Grpc.HealthCheck/HealthGrpc.cs @@ -72,13 +72,13 @@ public interface IHealthClient [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IHealth { - Task Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context); + global::System.Threading.Tasks.Task Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context); } /// Base class for server-side implementations of Health public abstract class HealthBase { - public virtual Task Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Check(global::Grpc.Health.V1.HealthCheckRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } diff --git a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs index aa4f1c5c3ec5d..9d31d1c5146c6 100644 --- a/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/MetricsGrpc.cs @@ -112,11 +112,11 @@ public interface IMetricsService /// Returns the values of all the gauges that are currently being maintained by /// the service /// - Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter responseStream, ServerCallContext context); /// /// Returns the value of one gauge /// - Task GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context); + global::System.Threading.Tasks.Task GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context); } /// Base class for server-side implementations of MetricsService @@ -126,7 +126,7 @@ public abstract class MetricsServiceBase /// Returns the values of all the gauges that are currently being maintained by /// the service /// - public virtual Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -134,7 +134,7 @@ public virtual Task GetAllGauges(global::Grpc.Testing.EmptyMessage request, ISer /// /// Returns the value of one gauge /// - public virtual Task GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task GetGauge(global::Grpc.Testing.GaugeRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } diff --git a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs index 42bf5e0b58222..f7071ebf6bebe 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServicesGrpc.cs @@ -111,12 +111,12 @@ public interface IBenchmarkService /// One request followed by one response. /// The server returns the client payload as-is. /// - Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); + global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); /// /// One request followed by one response. /// The server returns the client payload as-is. /// - Task StreamingCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task StreamingCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); } /// Base class for server-side implementations of BenchmarkService @@ -126,7 +126,7 @@ public abstract class BenchmarkServiceBase /// One request followed by one response. /// The server returns the client payload as-is. /// - public virtual Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -135,7 +135,7 @@ public abstract class BenchmarkServiceBase /// One request followed by one response. /// The server returns the client payload as-is. /// - public virtual Task StreamingCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task StreamingCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -375,7 +375,7 @@ public interface IWorkerService /// and once the shutdown has finished, the OK status is sent to terminate /// this RPC. /// - Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); /// /// Start client with specified workload. /// First request sent specifies the ClientConfig followed by ClientStatus @@ -384,15 +384,15 @@ public interface IWorkerService /// and once the shutdown has finished, the OK status is sent to terminate /// this RPC. /// - Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); /// /// Just return the core count - unary call /// - Task CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context); + global::System.Threading.Tasks.Task CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context); /// /// Quit this worker /// - Task QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context); + global::System.Threading.Tasks.Task QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context); } /// Base class for server-side implementations of WorkerService @@ -406,7 +406,7 @@ public abstract class WorkerServiceBase /// and once the shutdown has finished, the OK status is sent to terminate /// this RPC. /// - public virtual Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task RunServer(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -419,7 +419,7 @@ public virtual Task RunServer(IAsyncStreamReader - public virtual Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task RunClient(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -427,7 +427,7 @@ public virtual Task RunClient(IAsyncStreamReader /// Just return the core count - unary call /// - public virtual Task CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task CoreCount(global::Grpc.Testing.CoreRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -435,7 +435,7 @@ public virtual Task RunClient(IAsyncStreamReader /// Quit this worker /// - public virtual Task QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task QuitWorker(global::Grpc.Testing.Void request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } diff --git a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs index f1878cbb556c7..cf43a77118cf0 100644 --- a/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs +++ b/src/csharp/Grpc.IntegrationTesting/TestGrpc.cs @@ -196,34 +196,34 @@ public interface ITestService /// /// One empty request followed by one empty response. /// - Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context); + global::System.Threading.Tasks.Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context); /// /// One request followed by one response. /// - Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); + global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context); /// /// One request followed by a sequence of responses (streamed download). /// The server returns the payload with client desired type and sizes. /// - Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context); /// /// A sequence of requests followed by one response (streamed upload). /// The server returns the aggregated size of client payload as the result. /// - Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context); + global::System.Threading.Tasks.Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context); /// /// A sequence of requests with each request served by the server immediately. /// As one request could lead to multiple responses, this interface /// demonstrates the idea of full duplexing. /// - Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); /// /// A sequence of requests followed by a sequence of responses. /// The server buffers all the client requests and then serves them in order. A /// stream of responses are returned to the client when the server starts with /// first request. /// - Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); + global::System.Threading.Tasks.Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context); } /// Base class for server-side implementations of TestService @@ -232,7 +232,7 @@ public abstract class TestServiceBase /// /// One empty request followed by one empty response. /// - public virtual Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task EmptyCall(global::Grpc.Testing.Empty request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -240,7 +240,7 @@ public abstract class TestServiceBase /// /// One request followed by one response. /// - public virtual Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task UnaryCall(global::Grpc.Testing.SimpleRequest request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -249,7 +249,7 @@ public abstract class TestServiceBase /// One request followed by a sequence of responses (streamed download). /// The server returns the payload with client desired type and sizes. /// - public virtual Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCallRequest request, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -258,7 +258,7 @@ public virtual Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCall /// A sequence of requests followed by one response (streamed upload). /// The server returns the aggregated size of client payload as the result. /// - public virtual Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task StreamingInputCall(IAsyncStreamReader requestStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -268,7 +268,7 @@ public virtual Task StreamingOutputCall(global::Grpc.Testing.StreamingOutputCall /// As one request could lead to multiple responses, this interface /// demonstrates the idea of full duplexing. /// - public virtual Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task FullDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -279,7 +279,7 @@ public virtual Task FullDuplexCall(IAsyncStreamReader - public virtual Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task HalfDuplexCall(IAsyncStreamReader requestStream, IServerStreamWriter responseStream, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -525,7 +525,7 @@ public interface IUnimplementedService /// /// A call that no server should implement /// - Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context); + global::System.Threading.Tasks.Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context); } /// Base class for server-side implementations of UnimplementedService @@ -534,7 +534,7 @@ public abstract class UnimplementedServiceBase /// /// A call that no server should implement /// - public virtual Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task UnimplementedCall(global::Grpc.Testing.Empty request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } @@ -669,19 +669,19 @@ public interface IReconnectServiceClient [System.Obsolete("Service implementations should inherit from the generated abstract base class instead.")] public interface IReconnectService { - Task Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context); - Task Stop(global::Grpc.Testing.Empty request, ServerCallContext context); + global::System.Threading.Tasks.Task Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context); + global::System.Threading.Tasks.Task Stop(global::Grpc.Testing.Empty request, ServerCallContext context); } /// Base class for server-side implementations of ReconnectService public abstract class ReconnectServiceBase { - public virtual Task Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Start(global::Grpc.Testing.ReconnectParams request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); } - public virtual Task Stop(global::Grpc.Testing.Empty request, ServerCallContext context) + public virtual global::System.Threading.Tasks.Task Stop(global::Grpc.Testing.Empty request, ServerCallContext context) { throw new RpcException(new Status(StatusCode.Unimplemented, "")); }