diff --git a/Core/src/main/java/com/songoda/core/database/DataManagerAbstract.java b/Core/src/main/java/com/songoda/core/database/DataManagerAbstract.java index 540b68a6..caad10d0 100644 --- a/Core/src/main/java/com/songoda/core/database/DataManagerAbstract.java +++ b/Core/src/main/java/com/songoda/core/database/DataManagerAbstract.java @@ -12,6 +12,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.function.Consumer; +import java.util.concurrent.CompletableFuture; public class DataManagerAbstract { @@ -68,6 +69,16 @@ public class DataManagerAbstract { public void async(Runnable runnable) { Bukkit.getScheduler().runTaskAsynchronously(this.plugin, runnable); } + + /** + * Queue a task to be run asynchronously with all the + * advantages of CompletableFuture api
+ * + * @param runnable task to run + */ + public CompletableFuture asyncFuture(Runnable runnable) { + return CompletableFuture.runAsync(runnable); + } /** * Queue a task to be run synchronously.