I'm attempting to submit a task to a ScheduledExecutorService like shown below.
@Override
public CompletableFuture<Boolean> isOnlineDataExistent(UUID playerUUID) {
CompletableFuture<Boolean> completableFuture = new CompletableFuture<>();
this.getBackendAPI().getScheduler().submit(() -> {
System.out.println("Result completed.");
// isOnlineDataExistent call blocks the thread to queue on the database.
completableFuture.complete(this.getBackendAPI().isOnlineDataExistent(playerUUID));
}
return completableFuture;
This is the ScheduledExecutorSercice implementation I'm using: https://hastebin.com/bamigucaha.java
My issue is that the task is never processed by the Executor. It's like "submit" was never called.
Getting the task and using "get()" on it results in the thread getting blocked and does not even throw an exception as a result.
Help, Thank you!