mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Shove login processing into an async task.
ez
This commit is contained in:
1 parent
c1ef5ff8ae
commit
cbd1d66f60
4 files changed
+27
-14
No files matched your search
@@ -24,6 +24,7 @@ import java.lang.reflect.Type;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
@@ -78,6 +79,11 @@ public class JSONUserService<T extends PlayerUser, C extends ConsoleUser> implem
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull CompletableFuture<T> wrapLater(final @NonNull UUID uuid) {
|
||||
return CompletableFuture.supplyAsync(() -> this.wrap(uuid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable C consoleUser() {
|
||||
return this.consoleFactory.get();
|
||||
|
||||
@@ -30,6 +30,7 @@ import java.util.Map;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
@@ -124,6 +125,11 @@ public class MySQLUserService<T extends PlayerUser, C extends ConsoleUser> imple
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull CompletableFuture<T> wrapLater(final @NonNull UUID uuid) {
|
||||
return CompletableFuture.supplyAsync(() -> this.wrap(uuid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable C consoleUser() {
|
||||
return this.consoleFactory.get();
|
||||
|
||||
Reference in new issue
Block a user