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

Adding & enhancing client apis over gRPC #244

Merged
merged 32 commits into from
Mar 10, 2020
Merged

Adding & enhancing client apis over gRPC #244

merged 32 commits into from
Mar 10, 2020

Conversation

amanbha
Copy link
Contributor

@amanbha amanbha commented Mar 7, 2020

Summary of Changes:

  • Removed individual clients for Publish, State and Invoke.
  • Added single DaprClient and its implementation which is a wrapper over auto generated gRPC code.
  • Added client calls for InvokeMethod, State, Binding, Publish and secret which work over gRPC
  • Aded Etag and state options support to state apis.
  • Added metadata support to Apis.
  • Added a DaprClientBuilder to create DaprClient.
  • Renamed autogenerated grpc client project.
  • Updated unit tests to use gRPC.

It will close multiple issues:
#226
#225
#224
#223
#243
#221
#142

@amanbha amanbha requested review from rynowak and LMWF March 7, 2020 18:50
amanbha and others added 2 commits March 8, 2020 00:27
* ADding Secret Apis

* Using Task for secret
all.sln Outdated Show resolved Hide resolved
all.sln Outdated Show resolved Hide resolved
src/Dapr.AspNetCore/Dapr.AspNetCore.csproj Outdated Show resolved Hide resolved
src/Dapr.Client/ConcurrencyMode.cs Show resolved Hide resolved
src/Dapr.Client/DaprClient.cs Outdated Show resolved Hide resolved
src/Dapr.Client/DaprClient.cs Outdated Show resolved Hide resolved
src/Dapr.Client/StateEntry.cs Outdated Show resolved Hide resolved
src/Dapr.Client/StateEntry.cs Outdated Show resolved Hide resolved
src/Dapr.Client/StateEntry.cs Outdated Show resolved Hide resolved
src/Dapr.Client/StateEntry.cs Show resolved Hide resolved
src/Dapr.Client/DaprClientBuilder.cs Outdated Show resolved Hide resolved
src/Dapr.Client/DaprClientBuilder.cs Show resolved Hide resolved
}
else
{
channel = GrpcChannel.ForAddress(this.daprEndpoint, this.gRPCChannelOptions);
Copy link

Choose a reason for hiding this comment

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

Could do:

channel = GrpcChannel.ForAddress(this.daprEndpoint, this.gRPCChannelOptions ?? new GrpcChannelOptions());

src/Dapr.Client/StateOptions.cs Outdated Show resolved Hide resolved
@@ -59,6 +59,13 @@ public abstract class DaprClient
/// <param name="metadata">A key/value pair to pass to the method to invoke.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken" /> that can be used to cancel the operation.</param>
/// <returns>A <see cref="Task" /> that will complete when the operation has completed.</returns>
/// <remarks>If the target service is listening on http, a key value pair of http.verb and the verb must be added to the metadata parameter.
/// For example:
Copy link
Collaborator

Choose a reason for hiding this comment

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

<example>

@@ -223,7 +226,7 @@ public async ValueTask<StateEntry<TValue>> GetStateEntryAsync<TValue>(string sto
public abstract ValueTask<bool> TryDeleteStateAsync(
string storeName,
string key,
ETag etag,
string etag,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have a big objection to this, but the rationale for making ETag its own type is to make it clear to users that they should not try to guess a good value for an etag. Making it a simple string makes it appear like something users can create.

rynowak
rynowak previously approved these changes Mar 10, 2020
@amanbha
Copy link
Contributor Author

amanbha commented Mar 10, 2020

@rynowak Could you please approve it again, addressing some of the review comments resetted the review.

@amanbha
Copy link
Contributor Author

amanbha commented Mar 10, 2020

@LMWF @JamesNK Could you please approve it as well.

@amanbha amanbha merged commit 51fc48f into master Mar 10, 2020
@amanbha amanbha mentioned this pull request Mar 10, 2020
@amanbha amanbha deleted the one_client branch March 11, 2020 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants