Skip to content

Commit

Permalink
GH-39335: [C#] Support creating FlightClient with Grpc.Core.Channel (#…
Browse files Browse the repository at this point in the history
…39348)

as well as Grpc.Net.Client.GrpcChannel by changing our constructor arg to Grpc.Core.ChannelBase which both classes inherit from.

### Rationale for this change

### What changes are included in this PR?

Changing the constructor of C#'s Flight Client to take in a ChannelBase which allows for multiple implementations of gRPC channels to be passed in.

### Are these changes tested?

Existing tests already cover the use but have also manually tested in a separate app (

### Are there any user-facing changes?

No as we're just changing the constructor to take in a parent/base class instead.
* Closes: #39335

Authored-by: John Garland <[email protected]>
Signed-off-by: Curt Hagenlocher <[email protected]>
  • Loading branch information
johnnyg authored Dec 22, 2023
1 parent a4a3d3f commit 87971df
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions csharp/src/Apache.Arrow.Flight/Client/FlightClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@
using System.Threading.Tasks;
using Apache.Arrow.Flight.Internal;
using Apache.Arrow.Flight.Protocol;
using Apache.Arrow.Flight.Server;
using Apache.Arrow.Flight.Server.Internal;
using Grpc.Core;
using Grpc.Net.Client;

namespace Apache.Arrow.Flight.Client
{
Expand All @@ -29,7 +27,7 @@ public class FlightClient

private readonly FlightService.FlightServiceClient _client;

public FlightClient(GrpcChannel grpcChannel)
public FlightClient(ChannelBase grpcChannel)
{
_client = new FlightService.FlightServiceClient(grpcChannel);
}
Expand Down

0 comments on commit 87971df

Please sign in to comment.