retrieval queue cleanup

This commit is contained in:
James Seibel
2026-02-07 17:57:03 -06:00
parent b6b13843eb
commit 7201df1eff
@@ -30,17 +30,16 @@ import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
* Used to track what full data sources the system currently
* Used to track what some of the full data sources the system currently
* wants but doesn't have. <br>
* IE, what sections should be generated via the world generator. <br><br>
*
* Note: <br>
* This won't contain every position that needs to be retrieved
* (due to causing issues at extreme render distances).
* TODO does that mean this object isn't necessary or
* should just be renamed since it isn't the full queue <br><br>
* since that would cause issues when moving or with extreme
* render distances. <br><br>
*
* Use by both world gen and server networking.
* Used by both world gen and server networking.
*
* @see LodQuadTree
*/
@@ -49,6 +48,7 @@ public interface IFullDataSourceRetrievalQueue extends Closeable
//=========//
// getters //
//=========//
//region
/**
* The largest numerical detail level. <br>
@@ -63,11 +63,14 @@ public interface IFullDataSourceRetrievalQueue extends Closeable
*/
byte highestDataDetail();
//endregion
//=======//
// setup //
//=======//
//region
/**
* Starts the retrieval process if not already running,
@@ -78,11 +81,14 @@ public interface IFullDataSourceRetrievalQueue extends Closeable
* */
void startAndSetTargetPos(DhBlockPos2D targetPos);
//endregion
//===============//
// task handling //
//===============//
//region
/**
* Generally the retrieval queue should be fairly small, so its faster to iterate over the existing list
@@ -92,11 +98,14 @@ public interface IFullDataSourceRetrievalQueue extends Closeable
CompletableFuture<DataSourceRetrievalResult> submitRetrievalTask(long pos, byte requiredDataDetail);
//endregion
//==========//
// shutdown //
//==========//
//region
/** Can be used to let any lingering generation requests finish before fully shutting down the system */
CompletableFuture<Void> startClosingAsync(boolean cancelCurrentGeneration, boolean alsoInterruptRunning);
@@ -104,11 +113,14 @@ public interface IFullDataSourceRetrievalQueue extends Closeable
@Override
void close();
//endregion
//===============//
// debug display //
//===============//
//region
int getWaitingTaskCount();
int getInProgressTaskCount();
@@ -129,6 +141,8 @@ public interface IFullDataSourceRetrievalQueue extends Closeable
/** Can be used to determine roughly how fast the world generator is running. */
RollingAverage getRollingAverageChunkGenTimeInMs();
//endregion
}