public abstract class Scheduler<K,T extends ITaskType<K,T>,R>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Scheduler.FutureWrapper |
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.ExecutorService |
schedulerPool |
Constructor and Description |
---|
Scheduler(java.lang.String name,
int concurrency,
T p_i48724_3_,
java.util.function.Supplier<java.util.Map<T,java.util.concurrent.CompletableFuture<R>>> p_i48724_4_,
java.util.function.Supplier<java.util.Map<T,java.util.concurrent.CompletableFuture<java.lang.Void>>> p_i48724_5_) |
Modifier and Type | Method and Description |
---|---|
protected Scheduler.FutureWrapper |
createFutureWrapper(K key) |
protected abstract Scheduler.FutureWrapper |
func_212252_a_(K p_212252_1_,
boolean p_212252_2_) |
R |
func_212537_b(K p_212537_1_,
boolean p_212537_2_) |
java.util.concurrent.CompletableFuture<R> |
gather() |
java.util.concurrent.CompletableFuture<R> |
getLastFuture() |
protected abstract void |
onTaskFinish(K key,
Scheduler.FutureWrapper futureWrapper) |
protected abstract Scheduler.FutureWrapper |
onTaskStart(K pos,
Scheduler.FutureWrapper futureWrapperIn) |
protected abstract R |
runTask(K key,
T taskType,
java.util.Map<K,R> providingMap) |
java.util.concurrent.CompletableFuture<R> |
schedule(K key) |
void |
shutdown() |
public java.util.concurrent.CompletableFuture<R> gather()
protected Scheduler.FutureWrapper createFutureWrapper(K key)
@Nullable protected abstract Scheduler.FutureWrapper func_212252_a_(K p_212252_1_, boolean p_212252_2_)
public void shutdown() throws java.lang.InterruptedException
java.lang.InterruptedException
public java.util.concurrent.CompletableFuture<R> getLastFuture()
protected abstract void onTaskFinish(K key, Scheduler.FutureWrapper futureWrapper)
protected abstract Scheduler.FutureWrapper onTaskStart(K pos, Scheduler.FutureWrapper futureWrapperIn)