-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
subscriber: allow disabling tonic
's "transport" feature
#333
Comments
(@LucioFranco might have advice on this?) |
I think having a transport feature makes sense. The feature was added for use cases like this. The channel one is just there if you do client only interaction. |
Oh, okay, so it seems like the |
Is this issue still prevalent? Would love to take it on if so. |
+1. I came here looking for a way to avoid pulling in axum, etc to my codebase that uses console-subscriber. I was rather surprised to see the huge dependency list in cargo tree. |
@dan-da Not really much to say here except that pulling in Tonic / Axum, plus a number of other crates for specific features or use cases all adds up. If you have suggestions for reducing this that would be interesting, but a top priority is maintainability, and adding a lot more code to |
What problem are you trying to solve?
Currently,
console-subscriber
enablestonic
's "transport" feature flag unconditionally. This feature flag pulls in a relatively large set of additional dependencies, includingaxum
(used for routing). This feature is necessary to enable some of the one-stopserve
methods on theServer
struct.However,
Server
also implements the tonic-generatedInstrument
trait for the gRPC bindings. In some use-cases, users may want to bind the API to an endpoint themselves, rather than usingtonic
's "transport" feature. It's possible to do this now using theServer
type's other trait implementations...but users who do this will still be pulling in a bunch of code they don't actually use.How should the problem be solved?
We should make it possible to disable
tonic/transport
. We could feature-flag the APIs that requiretransport
, and make them depend on a "transport" feature flag onconsole-subscriber
.Any alternatives you've considered?
We may additionally want to look into using
tonic
's "channel" feature flag, a subset of "transport" that doesn't depend onaxum
. I think we can probably do this because theserve
andserve_with
methods don't serve multiple gRPC APIs on the same port, and don't need routing?How would users interact with this feature?
No response
Would you like to work on this feature?
maybe
The text was updated successfully, but these errors were encountered: