You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
Today, the plugin uses the Bukkit scheduler to update the world weather and time using external API calls. This works well when the weather API returns in a timely manner. I've seen a few issues lately across my network where the API calls take a while, and the whole server lags. It took a while to track down, but some thread dumps did the trick.
However, when there's a network interruption, outage, or lag with the HTTP response times, your main thread of the server is left hanging for up to 15 seconds.
The call to the weather API should be done on another thread. Bukkit/Spigot/Paper don't permit you to update in-game attributes (like world or player data) off the main thread. However, this shouldn't be a problem.
You can have the craft scheduler periodically run and refresh the data from the API on another thread. It can update plugin-managed variable/map of the weather/time.
You have another scheduled task that reads the updated world data from your plugin-managed data structure, and it uses that (on the main thread) to update the world.
With this solution, you'll never have your main thread hanging around waiting for the API call to return.
The text was updated successfully, but these errors were encountered:
Today, the plugin uses the Bukkit scheduler to update the world weather and time using external API calls. This works well when the weather API returns in a timely manner. I've seen a few issues lately across my network where the API calls take a while, and the whole server lags. It took a while to track down, but some thread dumps did the trick.
However, when there's a network interruption, outage, or lag with the HTTP response times, your main thread of the server is left hanging for up to 15 seconds.
The call to the weather API should be done on another thread. Bukkit/Spigot/Paper don't permit you to update in-game attributes (like world or player data) off the main thread. However, this shouldn't be a problem.
With this solution, you'll never have your main thread hanging around waiting for the API call to return.
The text was updated successfully, but these errors were encountered: