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

Support zstd-stream gateway compression #598

Merged
merged 6 commits into from
May 18, 2024
Merged

Support zstd-stream gateway compression #598

merged 6 commits into from
May 18, 2024

Conversation

jb3
Copy link
Collaborator

@jb3 jb3 commented May 18, 2024

This adds support for zstd-stream compression through configuration of the
:gateway_compression configuration option.

This will optionally use the :ezstd library to decompress received payloads from
Discord allowing for some potential savings on payload size.

This also moves the ws_state to be agnostic and references the compression
context as compress_ctx instead of the previous zlib_ctx.

We add an optional dependency for :ezstd. I have not made this mandatory as it
requires natively built functions and as such I cannot guarantee how
cross-platform it is or in what environments it will build.

zstd-stream compression is documented upstream by discord/discord-api-docs#6877.

@jb3 jb3 force-pushed the jb3/zstd branch 2 times, most recently from 1498b81 to 3560892 Compare May 18, 2024 01:17
mix.exs Outdated Show resolved Hide resolved
jb3 added 4 commits May 18, 2024 07:10
This adds support for zstd-stream compression through configuration of
the :gateway_compression configuration option.

This will optionally use the :ezstd library to decompress received
payloads from Discord allowing for some potential savings on payload
size.

This also moves the ws_state to be agnostic and references the
compression context as `compress_ctx` instead of the previous
`zlib_ctx`.
@jchristgit jchristgit merged commit 3ec78d4 into master May 18, 2024
9 checks passed
@jchristgit
Copy link
Collaborator

Thanks!

@jchristgit jchristgit deleted the jb3/zstd branch May 18, 2024 06:31
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.

2 participants