Fixes: #559
This change adds disposable support to DaprClient, and updates samples
to dispose it.
I didn't update tests because there are literally hundreds of
non-find-and-replacable cases, and we're not actually doing networking
in our tests so it won't cause an issue.
Fixes: #549
This change mixes up the service invocation APIs to reflect some changes
that are coming down the pipe in dapr/dapr#2683.
We're now using HTTP's semantics and JSON for the main functionality in
`InvokeMethodAsync`. This means that the error handling is simplified
and base on HTTP's status codes rather than trying to abstract over HTTP
and gRPC's different error models. This also means that we're free to
expose HttpRequestMessage and related types in the API because it's no
longer an abstraction.
You can still use `InvokeMethodAsync` to invoke gRPC services, but you
will get a status code in the response, and it will expect JSON, etc,
similar to how gRPC gateway works.
In addition to that we're added `InvokeMethodGrpcAsync` for cases where
you really want *gRPC's* semantics. These methods do Protobuf
serialization, as is a natural choice for gRPC. I do not recommend using
this approach to invoke HTTP services.
---
I also mad updates and improvments to various infrastructure where
necessary (like InvocationException). Also, the gRPC sample in the repo
now uses the new `InvokeMethodGrpcAsync` APIs.
- Adds a new message handler for HttpClient interop
- Adds an easy way to create HttpClient instances
- A bunch of sample cleanup/polish/simplification
The main thing here is the added ability to interop with HttpClient. We'll be making some future changes to the service invocation APIs in DaprClient to address dapr/dapr#2342 since that issues greatly simplifies the interface we're dealing with.
Fixes: #526
Fixes: #395
This change uses the IReadOnlyDictionary<> interface type where
possible, in particularly where we accept metadata. This allows the use
of the immutable collection types as parameters, as well as communicates
the contract - the SDK will read the metadata but not write to it. This
is helpful, because it communicates clearly to the user that they can
create a shared metadata collection instance and reuse them across
calls.
* state operation overload with meta #412
* added metadata to bulk state
* getStateAndEtag with metadata test
* an -> a keyvalue pair
* Added GetBulkStateAsync_ValidateRequest
* update
* update
* removed backup files
* metadata docs
* state store metadata docs
Co-authored-by: Ryan Nowak <nowakra@gmail.com>
We've had a list of linting-related messages piling up for a while now.
This change bulk-applies these suggestions with usually relate to
simplification or use or newer language features like ??=
The only changes I did manually here are:
Removing some usage of Task.GetAwaiter().GetResult() where it was
just laziness
Removing some dead code in methods and parameters of internal APIs.
* Add bulk get to client
* change params, return type, class to struct
* change IList to IReadOnlyList, make parallelism nullable
* change GetBulkItem to BulkStateItem
* adding IDAprClient interface
* Adding DaprClientBuilder and adding methods for Publish
* updating the method name for publish
* Adding unit tests for publishevent api
* Removing individual clients for publish
* Renaming base class to DaprClient and implementation calss to DparClientGrpc
* Moving State api to grpc and adding helpers to unittest grpc calls.
* More DaprClient logic
* metadata, etag, options, etc are optional
* Revert "metadata, etag, options, etc are optional"
This reverts commit ea5dc12c5d.
* Default params, 2 new Try- methods, overload refactor for InvokeMethodAsync
* Move some classes/enums to different files. Documentation
* Code refactor and changing tests to use grpc
* Adding tests with state options
* Adding test for getting etag and state
* More refactoring and adding INvokeBinding test
* Fixing tests and tidying up things.
* Updating solutions for renamed project
* Updating projects for rename.
* Oneclient secret (#245)
* ADding Secret Apis
* Using Task for secret
* Format (#242)
* Updating samples.slm
* awaint the call to grpc in common method so that common error handling can be done there.
* Addressing review comments
* fixing test.sln
* updating prod.sln
* Addressing review comments from James.
* Add doc and example for method invocation on http app
* Updating arg validation.
* Updating example.
Co-authored-by: LM <lemai>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
* Including state Store name in the APIs to support multi state store scenario in SDK
* correcting the typo in the comment.
* Respective Changes to the tests
* Changes in StateAttribute and Binder classes to support state store name
* Changes in StateEntryModelBinderTests
* StoreName changes in the Integration test app
* fixing build issues
* Fixing integration tests
* Addressing review comments.
* Addressing review comments
* Updating samples to use correct state store name as generated by dapr cli.
Co-authored-by: Aman Bhardwaj <amanbha@users.noreply.github.com>