Skip to content

Conversation

@freya022
Copy link
Contributor

Pull Request Etiquette

  • I have checked the PRs for upcoming features/bug fixes.
  • I have read the contributing guidelines.
  • I applied the code formatter to my changes with ./gradlew format

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Closes Issue: NaN

Description

This PR creates a new API to decompress gateway messages, which external libraries can hook into.

At the time of writing, the only library using this is discord-zstd-java.

Supersedes #2982

Changes

Both JDABuilder and DefaultShardManagerBuilder had their setMaxBufferSize, setCompression and setGatewayEncoding deprecated. They are now configured with setGatewayConfig and setGatewayConfigProvider.

New features

Decompression using InputStream was added and is configurable in GatewayConfig

  • This is opt-in and allows even higher efficiency at the cost of no JSON being logged in case of decompression/decoding errors
  • Currently, this mode does not allow using the ETF encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants