PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Public Member Functions | |
__construct (Server $server, int $type, array $playerList=[]) | |
checkProgressUpdates () | |
getResult () | |
hasResult () | |
isFinished () | |
isSubmitted () | |
onCompletion () | |
onProgressUpdate ($progress) | |
onRun () | |
publishProgress (mixed $progress) | |
run () | |
setResult (mixed $result) | |
setSubmitted () | |
Public Attributes | |
string | $data |
string | $endpoint |
const | TYPE_CLOSE = 3 |
const | TYPE_OPEN = 1 |
const | TYPE_STATUS = 2 |
Protected Member Functions | |
fetchLocal (string $key) | |
reallyDestruct () | |
storeLocal (string $key, mixed $complexData) | |
Definition at line 47 of file SendUsageTask.php.
pocketmine\stats\SendUsageTask::__construct | ( | Server | $server, |
int | $type, | ||
array | $playerList = [] ) |
string[] | $playerList | @phpstan-param array<string, string> $playerList |
Definition at line 60 of file SendUsageTask.php.
References pocketmine\Server\getOnlinePlayers(), pocketmine\Server\getTicksPerSecondAverage(), and pocketmine\Server\getTickUsageAverage().
|
inherited |
Definition at line 151 of file AsyncTask.php.
|
protectedinherited |
Retrieves data stored in thread-local storage.
If you used storeLocal(), you can use this on the same thread to fetch data stored. This should be used during onProgressUpdate() and onCompletion() to fetch thread-local data stored on the parent thread.
InvalidArgumentException if no data were stored by this AsyncTask instance.
Definition at line 200 of file AsyncTask.php.
|
inherited |
Definition at line 102 of file AsyncTask.php.
|
inherited |
Definition at line 95 of file AsyncTask.php.
|
inherited |
Returns whether this task has finished executing, whether successfully or not. This differs from isRunning() because it is not true prior to task execution.
Definition at line 91 of file AsyncTask.php.
|
inherited |
Definition at line 117 of file AsyncTask.php.
|
inherited |
Actions to execute when completed (on main thread) Implement this if you want to handle the data in your AsyncTask after it has been processed
Reimplemented in pocketmine\network\mcpe\auth\ProcessLoginTask, pocketmine\network\mcpe\ChunkRequestTask, pocketmine\network\mcpe\compression\CompressBatchTask, pocketmine\network\mcpe\encryption\PrepareEncryptionTask, pocketmine\scheduler\BulkCurlTask, pocketmine\updater\UpdateCheckTask, pocketmine\world\generator\PopulationTask, and pocketmine\world\light\LightPopulationTask.
Definition at line 130 of file AsyncTask.php.
|
inherited |
Called from the main thread after AsyncTask::publishProgress
is called. All AsyncTask::publishProgress
calls should result in AsyncTask::onProgressUpdate
calls before AsyncTask::onCompletion
is called.
mixed | $progress | The parameter passed to AsyncTask#publishProgress . It is serialize()'ed and then unserialize()'ed, as if it has been cloned. |
Definition at line 168 of file AsyncTask.php.
pocketmine\stats\SendUsageTask::onRun | ( | ) |
Actions to execute when run
Reimplemented from pocketmine\scheduler\AsyncTask.
Definition at line 154 of file SendUsageTask.php.
|
inherited |
Call this method from AsyncTask::onRun
(AsyncTask execution thread) to schedule a call to AsyncTask::onProgressUpdate
from the main thread with the given progress parameter.
mixed | $progress | A value that can be safely serialize()'ed. |
Definition at line 140 of file AsyncTask.php.
|
protectedinherited |
Override this to do normal __destruct() cleanup from a child class.
Definition at line 217 of file AsyncTask.php.
|
inherited |
Definition at line 78 of file AsyncTask.php.
|
inherited |
Definition at line 109 of file AsyncTask.php.
|
inherited |
Definition at line 113 of file AsyncTask.php.
|
protectedinherited |
Saves mixed data in thread-local storage. Data stored using this storage is only accessible from the thread it was stored on. Data stored using this method will not be serialized. This can be used to store references to variables which you need later on on the same thread, but not others.
For example, plugin references could be stored in the constructor of the async task (which is called on the main thread) using this, and then fetched in onCompletion() (which is also called on the main thread), without them becoming serialized.
Scalar types can be stored directly in class properties instead of using this storage.
Objects stored in this storage can be retrieved using fetchLocal() on the same thread that this method was called from.
Definition at line 186 of file AsyncTask.php.
Referenced by pocketmine\network\mcpe\auth\ProcessLoginTask\__construct(), pocketmine\network\mcpe\ChunkRequestTask\__construct(), pocketmine\network\mcpe\encryption\PrepareEncryptionTask\__construct(), pocketmine\scheduler\BulkCurlTask\__construct(), pocketmine\world\generator\PopulationTask\__construct(), and pocketmine\world\light\LightPopulationTask\__construct().
string pocketmine\stats\SendUsageTask::$data |
Definition at line 54 of file SendUsageTask.php.
string pocketmine\stats\SendUsageTask::$endpoint |
Definition at line 53 of file SendUsageTask.php.
const pocketmine\stats\SendUsageTask::TYPE_CLOSE = 3 |
Definition at line 51 of file SendUsageTask.php.
const pocketmine\stats\SendUsageTask::TYPE_OPEN = 1 |
Definition at line 49 of file SendUsageTask.php.
const pocketmine\stats\SendUsageTask::TYPE_STATUS = 2 |
Definition at line 50 of file SendUsageTask.php.