Move ClientBase to Grpc.Core.Api, change client project references to Grpc.Core.Api, use ChannelBase in codegen

pull/19599/head
James Newton-King 6 years ago
parent 6fbe9d916d
commit 46de95536a
No known key found for this signature in database
GPG Key ID: A66B2F456BF5526
  1. 2
      src/compiler/csharp_generator.cc
  2. 0
      src/csharp/Grpc.Core.Api/ClientBase.cs
  3. 60
      src/csharp/Grpc.Core.Api/Internal/UnimplementedCallInvoker.cs
  4. 36
      src/csharp/Grpc.Core.Api/LiteClientBase.cs
  5. 3
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
  6. 4
      src/csharp/Grpc.HealthCheck/Grpc.HealthCheck.csproj
  7. 2
      src/csharp/Grpc.HealthCheck/HealthGrpc.cs
  8. 3
      src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj
  9. 2
      src/csharp/Grpc.Reflection/Grpc.Reflection.csproj
  10. 2
      src/csharp/Grpc.Reflection/ReflectionGrpc.cs

@ -437,7 +437,7 @@ void GenerateClientStub(Printer* out, const ServiceDescriptor* service,
"/// <param name=\"channel\">The channel to use to make remote "
"calls.</param>\n",
"servicename", GetServiceClassName(service));
out->Print("public $name$(grpc::Channel channel) : base(channel)\n", "name",
out->Print("public $name$(grpc::ChannelBase channel) : base(channel)\n", "name",
GetClientClassName(service));
out->Print("{\n");
out->Print("}\n");

@ -0,0 +1,60 @@
#region Copyright notice and license
// Copyright 2015-2016 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using System;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Utils;
namespace Grpc.Core.Internal
{
/// <summary>
/// Call invoker that throws <c>NotImplementedException</c> for all requests.
/// </summary>
internal class UnimplementedCallInvoker : CallInvoker
{
public UnimplementedCallInvoker()
{
}
public override TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
}
}

@ -17,6 +17,7 @@
#endregion
using System;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
namespace Grpc.Core
@ -58,40 +59,5 @@ namespace Grpc.Core
{
get { return this.callInvoker; }
}
/// <summary>
/// Call invoker that throws <c>NotImplementedException</c> for all requests.
/// </summary>
private class UnimplementedCallInvoker : CallInvoker
{
public UnimplementedCallInvoker()
{
}
public override TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request)
{
throw new NotImplementedException();
}
public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options)
{
throw new NotImplementedException();
}
}
}
}

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Grpc.Core\Common.csproj.include" />
@ -10,6 +10,7 @@
<ItemGroup>
<ProjectReference Include="../Grpc.HealthCheck/Grpc.HealthCheck.csproj" />
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj" />
</ItemGroup>
<ItemGroup>

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Grpc.Core\Common.csproj.include" />
@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj">
<ProjectReference Include="../Grpc.Core.Api/Grpc.Core.Api.csproj">
<PrivateAssets>None</PrivateAssets>
</ProjectReference>
</ItemGroup>

@ -102,7 +102,7 @@ namespace Grpc.Health.V1 {
{
/// <summary>Creates a new client for Health</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public HealthClient(grpc::Channel channel) : base(channel)
public HealthClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for Health that uses a custom <c>CallInvoker</c>.</summary>

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Grpc.Core\Common.csproj.include" />
@ -10,6 +10,7 @@
<ItemGroup>
<ProjectReference Include="../Grpc.Reflection/Grpc.Reflection.csproj" />
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj" />
</ItemGroup>
<ItemGroup>

@ -26,7 +26,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Grpc.Core/Grpc.Core.csproj">
<ProjectReference Include="../Grpc.Core.Api/Grpc.Core.Api.csproj">
<PrivateAssets>None</PrivateAssets>
</ProjectReference>
</ItemGroup>

@ -69,7 +69,7 @@ namespace Grpc.Reflection.V1Alpha {
{
/// <summary>Creates a new client for ServerReflection</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ServerReflectionClient(grpc::Channel channel) : base(channel)
public ServerReflectionClient(grpc::ChannelBase channel) : base(channel)
{
}
/// <summary>Creates a new client for ServerReflection that uses a custom <c>CallInvoker</c>.</summary>

Loading…
Cancel
Save