Merge pull request #19853 from jtattermusch/move_channelextension

Move ChannelExtensions (interceptor support) to Grpc.Core.Api (for v1.23.x branch)
pull/19862/head
Jan Tattermusch 5 years ago committed by GitHub
commit fc1e185696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      src/csharp/Grpc.Core.Api/Interceptors/ChannelExtensions.cs
  2. 1
      src/csharp/Grpc.Core/ForwardedTypes.cs

@ -38,9 +38,9 @@ namespace Grpc.Core.Interceptors
/// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that /// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that
/// in this case, the last interceptor added will be the first to take control. /// in this case, the last interceptor added will be the first to take control.
/// </remarks> /// </remarks>
public static CallInvoker Intercept(this Channel channel, Interceptor interceptor) public static CallInvoker Intercept(this ChannelBase channel, Interceptor interceptor)
{ {
return new DefaultCallInvoker(channel).Intercept(interceptor); return channel.CreateCallInvoker().Intercept(interceptor);
} }
/// <summary> /// <summary>
@ -59,9 +59,9 @@ namespace Grpc.Core.Interceptors
/// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that /// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that
/// in this case, the last interceptor added will be the first to take control. /// in this case, the last interceptor added will be the first to take control.
/// </remarks> /// </remarks>
public static CallInvoker Intercept(this Channel channel, params Interceptor[] interceptors) public static CallInvoker Intercept(this ChannelBase channel, params Interceptor[] interceptors)
{ {
return new DefaultCallInvoker(channel).Intercept(interceptors); return channel.CreateCallInvoker().Intercept(interceptors);
} }
/// <summary> /// <summary>
@ -79,9 +79,9 @@ namespace Grpc.Core.Interceptors
/// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that /// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that
/// in this case, the last interceptor added will be the first to take control. /// in this case, the last interceptor added will be the first to take control.
/// </remarks> /// </remarks>
public static CallInvoker Intercept(this Channel channel, Func<Metadata, Metadata> interceptor) public static CallInvoker Intercept(this ChannelBase channel, Func<Metadata, Metadata> interceptor)
{ {
return new DefaultCallInvoker(channel).Intercept(interceptor); return channel.CreateCallInvoker().Intercept(interceptor);
} }
} }
} }

@ -38,6 +38,7 @@ using Grpc.Core.Utils;
[assembly:TypeForwardedToAttribute(typeof(CallInvoker))] [assembly:TypeForwardedToAttribute(typeof(CallInvoker))]
[assembly:TypeForwardedToAttribute(typeof(CallInvokerExtensions))] [assembly:TypeForwardedToAttribute(typeof(CallInvokerExtensions))]
[assembly:TypeForwardedToAttribute(typeof(CallOptions))] [assembly:TypeForwardedToAttribute(typeof(CallOptions))]
[assembly:TypeForwardedToAttribute(typeof(ChannelExtensions))]
[assembly:TypeForwardedToAttribute(typeof(ClientBase))] [assembly:TypeForwardedToAttribute(typeof(ClientBase))]
[assembly:TypeForwardedToAttribute(typeof(ClientBase<>))] [assembly:TypeForwardedToAttribute(typeof(ClientBase<>))]
[assembly:TypeForwardedToAttribute(typeof(ChannelCredentials))] [assembly:TypeForwardedToAttribute(typeof(ChannelCredentials))]

Loading…
Cancel
Save