Load scripts in main thread on server start
Suggestion
I think when the server starts, scripts should be always be loaded main threaded (even if the config says load async).
Why?
I think that when the server starts it should load main thread because right now when the server starts, it currently loads to slow which makes some players join earlier then expected and the skript does not have time to load the big files of the skript.
Other
N/A
Agreement
- [x] I have read the guidelines above and affirm I am following them with this suggestion.
I don't think we should push the loading to main thread, but we should have a block on the main thread until loading finishes. That should better support parallel loading too.
I don't think we should push the loading to main thread, but we should have a block on the main thread until loading finishes. That should better support parallel loading too.
Unfortunately this idea will not work, since async loading calls tasks synchronously throughout the process, meaning a block just causes a deadlock. The original idea of forcing the first load on the main thread is viable, though we will have to do some shenanigans with things that check if the loader is async, like the auto-reload syntax. It will fail to parse on startup because the loader was forced to be sync, which kind of defeats the whole purpose.