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

Java 21 #234

Closed
wants to merge 9 commits into from
Closed

Java 21 #234

wants to merge 9 commits into from

Conversation

seailz
Copy link
Member

@seailz seailz commented Sep 23, 2023

PR Details

  • I have checked the PRs for upcoming features/bug fixes.

What you've changed

  • Developer-facing library
  • Internal Code
  • Documentation

Description

Java 21 adds support for Project Loom's Virtual Threads, a new type of Thread that doesn't use an OS thread, rather a custom thread created by the JVM, therefore being useful for large quantities of Thread creation.

This PR updates the pom.xml to add support for Java 21, including updating other dependencies. It also updates the DiscordJarThreadAllocator class to create a new method, requestVirtualThread which will return a running virtual thread, similar to the requestThread method.

This should be backwards-compatible with older versions of Java, as discord.jar will check that the Java release version is 21 or higher before attempting to use virtual threads. It is, however, recommended that you do update your version, especially for larger applications or those with many intents enabled.

Virtual Threads are mainly intended to be used by the Gateway implementation but can also be included in other high throughput parts of the code.

@seailz seailz added type: feature Issue or PR is a feature that should be implemented priority: medium Medium priority status: completed labels Sep 23, 2023
@seailz seailz added this to the discord.jar 1.0 milestone Sep 23, 2023
@seailz seailz self-assigned this Sep 23, 2023
@seailz seailz closed this Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium Medium priority status: completed type: feature Issue or PR is a feature that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant