[FEATURE] Возможность использовать в runtime планировщик задач

This commit is contained in:
Gravit 2019-04-20 02:27:06 +07:00
parent 514e8e3535
commit b5cdb0c244

View file

@ -1,6 +1,5 @@
package ru.gravit.launcher.client;
import javafx.concurrent.Task;
import ru.gravit.launcher.HWID;
import ru.gravit.launcher.LauncherAPI;
import ru.gravit.launcher.events.request.AuthRequestEvent;
@ -15,15 +14,13 @@
import ru.gravit.launcher.serialize.signed.SignedObjectHolder;
import java.nio.file.Path;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicReference;
public class FunctionalBridge {
@LauncherAPI
public static LauncherSettings settings;
@LauncherAPI
public static ExecutorService worker = Executors.newWorkStealingPool();
public static ScheduledExecutorService threadPool = Executors.newScheduledThreadPool(4);
@LauncherAPI
public static OshiHWIDProvider hwidProvider = new OshiHWIDProvider();
@LauncherAPI
@ -48,8 +45,8 @@ public static void makeJsonRequest(RequestInterface request, Runnable callback)
}
@LauncherAPI
public static void startTask(@SuppressWarnings("rawtypes") Task task) {
worker.execute(task);
public static void startTask(Runnable task) {
threadPool.execute(task);
}
@LauncherAPI