Uses the asyncPool in DataManagerAbstract#asyncFuture (#22)

This commit is contained in:
Christian Koop 2022-03-18 16:17:15 +01:00
parent 7a85bd7a2a
commit f6b091bb79
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3

View File

@ -81,7 +81,7 @@ public class DataManagerAbstract {
public void async(Runnable runnable) { public void async(Runnable runnable) {
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, runnable); Bukkit.getScheduler().runTaskAsynchronously(this.plugin, runnable);
} }
/** /**
* Queue a task to be run asynchronously with all the * Queue a task to be run asynchronously with all the
* advantages of CompletableFuture api <br> * advantages of CompletableFuture api <br>
@ -89,7 +89,7 @@ public class DataManagerAbstract {
* @param runnable task to run * @param runnable task to run
*/ */
public CompletableFuture<Void> asyncFuture(Runnable runnable) { public CompletableFuture<Void> asyncFuture(Runnable runnable) {
return CompletableFuture.runAsync(runnable); return CompletableFuture.runAsync(runnable, this.asyncPool);
} }
/** /**