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

Make compression encoding configuration more malleable #1757

Merged
merged 1 commit into from
Jun 28, 2024
Merged

Conversation

djc
Copy link
Collaborator

@djc djc commented Jun 25, 2024

Motivation

Alternative approach to #1727, enable callers to influence compression encoding priority. Also changes the default order so that Zstd comes before Gzip if enabled (which happens when the zstd Cargo feature is explicitly enabled).

Solution

Implement an internal array while avoiding making changes to existing public API.

cc @CapCap

@djc djc requested review from LucioFranco and tottoto June 25, 2024 11:39
@djc djc force-pushed the minimal-encodings branch 3 times, most recently from f2b257e to d11f97e Compare June 25, 2024 12:37
Copy link
Collaborator

@tottoto tottoto left a comment

Choose a reason for hiding this comment

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

Thanks! I feel the design and implementation is readable and extensible. I commented on small points.

tonic/src/codec/compression.rs Show resolved Hide resolved
@djc
Copy link
Collaborator Author

djc commented Jun 27, 2024

Not completely sure whether this actually solves the original issue described in #1727. IMO it would be better if the config wrapper allowed overwriting the EnabledCompressionEncodings instead of appending to it.

@djc djc added this pull request to the merge queue Jun 28, 2024
Merged via the queue into master with commit 1b3fa89 Jun 28, 2024
16 checks passed
@djc djc deleted the minimal-encodings branch June 28, 2024 12:25
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.

4 participants