-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add optional default unimplemented stubs #1347
Comments
Is it possible to get comment on this issue and associated PR? I can expand it via unit tests/any other feedback if the team is open to merging such a feature. |
This feature has been discussed on discord. The following is a summary:
There are several options available to resolve this. Remove the associated type and elevate the stream so it's Pin and Boxed across the board (i.e. tonic::codegen::BoxStream).Pros:
Cons:
Only force BoxStream when generate_default_stubs is true.Pros:
Cons:
The PR in question has gone with option two to avoid breaking changes. See comments by @LucioFranco on older issue #221 for more details about this problem. I think rust-lang/rust#29661 won't be available for some time and option 2 is a good middle ground and avoids this issue re-appearing again. |
@LucioFranco any chance this could get an eye? :) |
Sorry for the delay on my response @xanather. This is a great write up and I think really the first option is the best but my concern is that I don't see this use case motivating enough to make this change. I would like to bundle a big breaking change to how we handle streams to include other ergonomic changes. I feel that maybe this could make sense once AFIT lands on stable which will force a breaking change to code gen'ed traits. I think if we bundled that together with other changes it would be a good candidate for one big breaking release change rather than a few. |
Thought I should create an issue with corresponding PR I submitted.
Feature Request
Crates
tonic-build
Motivation
Re-implement/undo #221 changes as optional feature.
This allows referencing gRPC models without version control which only permit backwards-compatible changes. It allows for setups provided by other programming language gRPC service generators that implement RPC's by default and return UNIMPLEMENTED error code for any methods which aren't explicitly handled.
Proposal
#1344
Alternatives
I did try seeing if I can use some macro magic outside the library, but it becomes quite a hack.
The text was updated successfully, but these errors were encountered: