mirror of
https://github.com/Dark98/SliceBeam.git
synced 2026-07-03 16:49:03 +00:00
Optimize boot time
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user