SpongePowered / VanillaGradle

A toolchain for Minecraft: Java Edition that builds a workspace to interact with the game using the official mappings provided to the public by Mojang Studios.
MIT License
89 stars 18 forks source link

Make concurrency less brittle #39

Closed zml2008 closed 2 years ago

zml2008 commented 3 years ago

Currently, due to Gradle restrictions some operations have to be completed on Gradle-owned threads, including any configuration resolution or execution of workers. This leads to some awkward and brittle arrangements to ensure configurations are resolved at the right points, most visible in DecompileJarTask and the infrastructure around produceAssociatedArtifactSync.

Instead, I'd like to see a way to have an Executor that can run on a Gradle thread, using a SynchronousQueue to pass tasks back to the Gradle thread, or something along those lines. This will let VG stay fully in CompletableFuture land for its operations, and more elegantly synchronize only when actually necessary.