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

Improve Scheduler safety #1178

Open
AzureAaron opened this issue Feb 17, 2025 · 0 comments
Open

Improve Scheduler safety #1178

AzureAaron opened this issue Feb 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@AzureAaron
Copy link
Collaborator

Describe the new feature.

Scheduling tasks with the Scheduler outside of the Render Thread should hard fail with an exception otherwise it could introduce hard to debug CMEs if a task is scheduled while the scheduler is being ticked. Currently to my knowledge only the API authentication does off-thread task scheduling.

Additionally scheduling a null task should fail with an NPE and the Preconditions class should be used to ensure tasks aren't being scheduled in the past and whatnot.

The migration path for any off-thread scheduling is just to wrap it in a client#send call like so: client.send(() -> Scheduler.INSTANCE.schedule(...)).

These changes will decrease the likelihood of the Scheduler being used improperly.

Images

No response

@AzureAaron AzureAaron added new feature This issue or PR is a new feature bug Something isn't working and removed new feature This issue or PR is a new feature labels Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant