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

refactor: get rid of Grpc.core dependency into ZeebeClient #727

Merged
merged 2 commits into from
Oct 18, 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
1 change: 1 addition & 0 deletions Client.UnitTests/Client.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Update="StyleCop.Analyzers" Version="1.1.118" />
<PackageReference Include="Grpc" version="2.46.6" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ This release is based on the Zeebe 8.5.6 release (https://github.com/zeebe-io/ze

<ItemGroup>
<PackageReference Include="Google.Protobuf" version="3.28.2" />
<PackageReference Include="Grpc" version="2.46.6" />
<PackageReference Include="Grpc.Auth" Version="2.66.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.66.0" />
<PackageReference Include="Grpc.Tools" version="2.67.0">
Expand Down
25 changes: 3 additions & 22 deletions Client/ZeebeClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,28 +135,9 @@ public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(TR
}
}

/// <summary>
/// Adds keepAlive options to the channel options.
/// </summary>
/// <param name="channelOptions">the current existing channel options.</param>
private void AddKeepAliveToChannelOptions(List<ChannelOption> channelOptions, TimeSpan? keepAlive)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait we didnt used this anymore? 😃😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know... It's private, so no risk.

{
// GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS
// This channel argument if set to 1 (0 : false; 1 : true), allows keepalive pings to be sent even if there are no calls in flight.
// channelOptions.Add(new ChannelOption("grpc.keepalive_permit_without_calls", "1"));
// this will increase load on the system and also increase used resources
// we should prefer idleTimeout setting
// https://stackoverflow.com/questions/57930529/grpc-connection-use-keepalive-or-idletimeout

// GRPC_ARG_KEEPALIVE_TIME_MS
// This channel argument controls the period (in milliseconds) after which a keepalive ping is sent on the transport.
var actualKeepAlive = keepAlive.GetValueOrDefault(DefaultKeepAlive);
channelOptions.Add(new ChannelOption("grpc.keepalive_time_ms", (int) actualKeepAlive.TotalMilliseconds));
}

////////////////////////////////////////////////////////////////////////
///////////////////////////// JOBS /////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
///////////////////////////// JOBS /////////////////////////////////////
////////////////////////////////////////////////////////////////////////

public IJobWorkerBuilderStep1 NewWorker()
{
Expand Down
Loading