Comments (12)
@artursouza There are APIs that are available in the protobuf but aren't exposed as higher-level APIs in Dapr. For example, see #164, which I fixed with a proposed PR #179, but if lower-level access had been available, people would have been able to do that even before the PR is merged.
I am sure there are other situations when having access to a lower-level API may be desirable. The API is stable anyways (for Dapr v1), so there wouldn't be the risk of exposing unstable APIs.
from go-sdk.
Thanks for the context. I understand your concerns and it makes sense.
Then maybe... Could there be a way to expose a method that returns a *grpc.ClientConn
object with the default options that Dapr uses and that can be passed to NewClientWithConnection
? This way one could still use NewClientWithConnection
but wouldn't have to instantiate the client entirely from scratch.
from go-sdk.
/cc @yaron2 @artursouza
from go-sdk.
You can already reuse an existing connection to dapr and have your own protoClient instance using the same connection with this API.
My question would be which calls you are trying to make to the "raw" sidecar API that the SDK cannot provide?
from go-sdk.
@ItalyPaleAle Would reuse a connection from the caller work for you? Then, you can create a protoClient reusing the same connection that you use to pass it into the SDK client.
The reason I am asking is that return protoClient would make this SDK gRPC specific. In the Java SDK, for example, the connection is abstracted and none of the methods are bound to HTTP or gRPC. This SDK can decide to be different but I think there is value in keeping the abstraction in the long term.
from go-sdk.
@artursouza are you referring to creating a connection in my code, then instantiating the SDK with NewClientWithConnection
? I see that.
That could work, although we'd lose out on some automatic plumbing (like reading the env vars to determine the port of the Dapr sidecar). But it may be a workaround.
Just wondering, what's the reason for having support for both HTTP and gRPC? Currently the Go SDK supports gRPC only, and I thought that was a superior way to communicate with the Dapr sidecar, when available?
from go-sdk.
@artursouza are you referring to creating a connection in my code, then instantiating the SDK with
NewClientWithConnection
? I see that.That could work, although we'd lose out on some automatic plumbing (like reading the env vars to determine the port of the Dapr sidecar). But it may be a workaround.
Correct.
Just wondering, what's the reason for having support for both HTTP and gRPC? Currently the Go SDK supports gRPC only, and I thought that was a superior way to communicate with the Dapr sidecar, when available?
For now, yes, gRPC is the best way to communicate. Keeping the SDK protocol independent can enable this to change in the long term. Again, the Java SDK chose to keep the communication protocol fully transparent and users can even switch between gRPC and HTTP via system properties. The Python SDK went a different path and is gRPC specific. In the short term there is no gain in keeping the abstraction but it is a one way door, once we cross that there is no (easy) way back.
from go-sdk.
/cc @yaron2 as the SDK maintainer.
/cc @berndverst FYI.
I think the logic to create a gRPC proto client to Dapr can be separate from creating the abstracted Dapr Client. So, the app can use the gRPC specific client builder method and reuse that when creating the abstract Dapr Client.
from go-sdk.
Makes sense.
I can propose a PR. I'm on vacation this week but I can do this next week or the one after, depending on how bad work is when I get back 😅
from go-sdk.
@ItalyPaleAle I can review it after you propose.
from go-sdk.
@yaron2 we would be interested in this feature and I guess it should be easy to implement. Should I open a PR?
from go-sdk.
@yaron2 we would be interested in this feature and I guess it should be easy to implement. Should I open a PR?
Sure, thanks
from go-sdk.
Related Issues (20)
- Support workflow ID reuse policy
- How to properly test HOT 5
- Cascade Terminate/Purge support for Workflow
- Workflows - Implement workflow id reuse policy HOT 1
- Workflows - Enable custom logger
- Flaky examples (socket & service & pubsub) HOT 2
- Module github.com/golang/protobuf is deprecated and needs to be replaced with google.golang.org/protobuf. HOT 1
- Workflows - Fan-out/fan-in pattern support
- Bulkpublisher should return an error HOT 2
- DaprClient has no field or method RenameActorReminder HOT 4
- Dependabot should be run on the dapr-bot HOT 5
- go-sdk 1.10.0 still depends on dapr 1.13.0-rc.7 HOT 1
- Crypto example not running / error when run HOT 2
- Workflow - Implement custom retry policies
- Update the holopin.yaml to use the sdk badge HOT 4
- Add support for Actor TTL
- Implement distributed scheduler building block (alpha)
- Fix override validate-examples workflow
- Standardize README shield badges HOT 3
- Panic if actor is called during app startup
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sdk.