Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-41347: [FlightRPC][C#] Allow hosting flight server in pre-Kestrel .net versions #41348

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion csharp/src/Apache.Arrow.Flight/Apache.Arrow.Flight.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netstandard2.1;net462</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,6 +13,10 @@
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net462'">
<PackageReference Include="Grpc.Core" Version="2.46.6" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Apache.Arrow\Apache.Arrow.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#if NET46_OR_GREATER

using Apache.Arrow.Flight.Protocol;
using Apache.Arrow.Flight.Server.Internal;
using Grpc.Core;

namespace Apache.Arrow.Flight.Server
{
public static class GrpcCoreFlightServerExtensions
{
/// <summary>
/// Create a ServerServiceDefinition for use with a <see href="https://grpc.github.io/grpc/csharp/api/Grpc.Core.Server.html">Grpc.Core Server</see>
// This allows running a flight server on pre-Kestrel .net Framework versions
/// </summary>
/// <param name="flightServer"></param>
/// <returns></returns>
public static ServerServiceDefinition CreateServiceDefinition(this FlightServer flightServer)
{
return FlightService.BindService(new FlightServerImplementation(flightServer));
}
}
}

#endif
Loading