LocateWorkerPool 5.46.0
A separate async pool with a single worker for /locate searches (biome noise sampling, structure placement checks).
The server's async pool also generates chunks, so long searches there delay terrain for players; this pool is started on first use and shut down after IDLE_SECONDS without work, so it costs nothing on servers that never use /locate. Callers should limit how many searches they queue (getPendingCount()).
Constants
IDLE_SECONDS
php
public const IDLE_SECONDS = 60Seconds without queued tasks after which the worker thread is stopped.
Methods
getInstance()
php
public static function getInstance(\pocketmine\Server $server) : selfgetPendingCount()
php
public function getPendingCount() : intNumber of tasks queued or running on the locate worker.
isRunning()
php
public function isRunning() : boolshutdown()
php
public function shutdown() : voidsubmitTask()
php
public function submitTask(\pocketmine\scheduler\AsyncTask $task) : voidSubmits a task to the locate worker, starting it if needed.
tick()
php
public function tick() : voidCollects finished tasks and stops the worker once it has been idle for IDLE_SECONDS. Called by the server once per second.
