public class AsyncReloader<S> extends java.lang.Object implements IAsyncReloader
Modifier and Type | Class and Description |
---|---|
static interface |
AsyncReloader.IStateFactory<S> |
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.CompletableFuture<Unit> |
allAsyncCompleted |
private java.util.concurrent.atomic.AtomicInteger |
asyncCompleted |
private java.util.concurrent.atomic.AtomicInteger |
asyncScheduled |
protected IResourceManager |
resourceManager |
protected java.util.concurrent.CompletableFuture<java.util.List<S>> |
resultListFuture |
private int |
syncCompleted |
private int |
syncScheduled |
private int |
taskCount |
private java.util.Set<IFutureReloadListener> |
taskSet |
Modifier | Constructor and Description |
---|---|
protected |
AsyncReloader(java.util.concurrent.Executor backgroundExecutor,
java.util.concurrent.Executor gameExecutor,
IResourceManager resourceManager,
java.util.List<IFutureReloadListener> listeners,
AsyncReloader.IStateFactory<S> stateFactory,
java.util.concurrent.CompletableFuture<Unit> alsoWaitedFor) |
Modifier and Type | Method and Description |
---|---|
boolean |
asyncPartDone() |
static AsyncReloader<java.lang.Void> |
create(IResourceManager resourceManager,
java.util.List<IFutureReloadListener> listeners,
java.util.concurrent.Executor backgroundExecutor,
java.util.concurrent.Executor gameExecutor,
java.util.concurrent.CompletableFuture<Unit> alsoWaitedFor) |
float |
estimateExecutionSpeed() |
boolean |
fullyDone() |
void |
join() |
java.util.concurrent.CompletableFuture<Unit> |
onceDone() |
protected final IResourceManager resourceManager
protected final java.util.concurrent.CompletableFuture<Unit> allAsyncCompleted
protected final java.util.concurrent.CompletableFuture<java.util.List<S>> resultListFuture
private final java.util.Set<IFutureReloadListener> taskSet
private final int taskCount
private int syncScheduled
private int syncCompleted
private final java.util.concurrent.atomic.AtomicInteger asyncScheduled
private final java.util.concurrent.atomic.AtomicInteger asyncCompleted
protected AsyncReloader(java.util.concurrent.Executor backgroundExecutor, java.util.concurrent.Executor gameExecutor, IResourceManager resourceManager, java.util.List<IFutureReloadListener> listeners, AsyncReloader.IStateFactory<S> stateFactory, java.util.concurrent.CompletableFuture<Unit> alsoWaitedFor)
public static AsyncReloader<java.lang.Void> create(IResourceManager resourceManager, java.util.List<IFutureReloadListener> listeners, java.util.concurrent.Executor backgroundExecutor, java.util.concurrent.Executor gameExecutor, java.util.concurrent.CompletableFuture<Unit> alsoWaitedFor)
public java.util.concurrent.CompletableFuture<Unit> onceDone()
onceDone
in interface IAsyncReloader
public float estimateExecutionSpeed()
estimateExecutionSpeed
in interface IAsyncReloader
public boolean asyncPartDone()
asyncPartDone
in interface IAsyncReloader
public boolean fullyDone()
fullyDone
in interface IAsyncReloader
public void join()
join
in interface IAsyncReloader