Move ClientBase to Grpc.Core.Api, change client project references to Grpc.Core.Api, use ChannelBase in codegen
This commit is contained in:
parent
6fbe9d916d
commit
46de95536a
|
|
@ -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…
Reference in New Issue