AsyncWorker
Extends Worker
Methods
__construct()
php
public function __construct(\pocketmine\thread\log\ThreadSafeLogger $logger, int $id, int $memoryLimit, \pocketmine\snooze\SleeperHandlerEntry $sleeperEntry)getAsyncWorkerId()
php
public function getAsyncWorkerId() : intgetFromThreadStore()
php
public function getFromThreadStore(string $identifier) : mixedDeprecated
Use static class properties instead.
Retrieves mixed data from the worker's thread-local object store.
Note that the thread-local object store could be cleared and your data might not exist, so your code should account for the possibility that what you're trying to retrieve might not exist.
Objects stored in this storage may ONLY be retrieved while the task is running.
getLogger()
php
public function getLogger() : \pocketmine\thread\log\ThreadSafeLoggergetNotifier()
php
public static function getNotifier() : \pocketmine\snooze\SleeperNotifiergetThreadName()
php
public function getThreadName() : stringmaybeCollectCycles()
php
public static function maybeCollectCycles() : voidonRun() protected
php
protected function onRun() : voidremoveFromThreadStore()
php
public function removeFromThreadStore(string $identifier) : voidDeprecated
Use static class properties instead.
Removes previously-stored mixed data from the worker's thread-local object store.
saveToThreadStore()
php
public function saveToThreadStore(string $identifier, mixed $value) : voidDeprecated
Use static class properties instead.
Saves mixed data into the worker's thread-local object store. This can be used to store objects which you want to use on this worker thread from multiple AsyncTasks.
