Optimize boot time

This commit is contained in:
utkabobr
2025-04-01 23:06:08 +03:00
parent 6092f123b5
commit 662018834e
14 changed files with 337 additions and 41 deletions
@@ -0,0 +1,33 @@
package ru.ytkab0bp.slicebeam.boot;
import java.util.Collections;
import java.util.List;
public class BootTask {
public final List<Class<?>> dependencies;
public final Runnable run;
public boolean workerThread;
public int priority;
/* package */ int index;
public BootTask(Runnable run) {
this.dependencies = Collections.emptyList();
this.run = run;
}
public BootTask(List<Class<?>> dependencies, Runnable run) {
this.dependencies = dependencies;
this.run = run;
}
public BootTask onWorker() {
return onWorker(-20);
}
public BootTask onWorker(int priority) {
this.workerThread = true;
this.priority = priority;
return this;
}
}