PocketMine-MP 5.23.3 git-976fc63567edab7a6fb6aeae739f43cf9fe57de4
|
Public Member Functions | |
__construct (array $operations, \Closure $onCompletion) | |
getResult () | |
hasResult () | |
isFinished () | |
isSubmitted () | |
onCompletion () | |
onRun () | |
run () | |
setResult (mixed $result) | |
setSubmitted () | |
Protected Member Functions | |
fetchLocal (string $key) | |
reallyDestruct () | |
storeLocal (string $key, mixed $complexData) | |
Executes a consecutive list of cURL operations.
The result of this AsyncTask is an array of arrays (returned from Internet::simpleCurl
) or InternetException objects.
Definition at line 37 of file BulkCurlTask.php.
pocketmine\scheduler\BulkCurlTask::__construct | ( | array | $operations, |
\Closure | $onCompletion ) |
BulkCurlTask constructor.
$operations accepts an array of arrays. Each member array must contain a string mapped to "page", and optionally, "timeout", "extraHeaders" and "extraOpts". Documentation of these options are same as those in Internet::simpleCurl
.
BulkCurlTaskOperation[] | $operations | @phpstan-param \Closure(list<InternetRequestResult|InternetException> $results) : void $onCompletion |
Definition at line 52 of file BulkCurlTask.php.
References pocketmine\scheduler\AsyncTask\storeLocal().
|
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 165 of file AsyncTask.php.
|
inherited |
Definition at line 105 of file AsyncTask.php.
|
inherited |
Definition at line 98 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 94 of file AsyncTask.php.
|
inherited |
Definition at line 120 of file AsyncTask.php.
pocketmine\scheduler\BulkCurlTask::onCompletion | ( | ) |
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 from pocketmine\scheduler\AsyncTask.
Definition at line 74 of file BulkCurlTask.php.
pocketmine\scheduler\BulkCurlTask::onRun | ( | ) |
Actions to execute when run
Reimplemented from pocketmine\scheduler\AsyncTask.
Definition at line 57 of file BulkCurlTask.php.
|
protectedinherited |
Override this to do normal __destruct() cleanup from a child class.
Definition at line 182 of file AsyncTask.php.
|
inherited |
Definition at line 73 of file AsyncTask.php.
|
inherited |
Definition at line 112 of file AsyncTask.php.
|
inherited |
Definition at line 116 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 151 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\scheduler\TimingsCollectionTask\__construct(), pocketmine\world\generator\PopulationTask\__construct(), and pocketmine\world\light\LightPopulationTask\__construct().