PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
pocketmine\scheduler\AsyncWorker Class Reference
+ Inheritance diagram for pocketmine\scheduler\AsyncWorker:
+ Collaboration diagram for pocketmine\scheduler\AsyncWorker:

Public Member Functions

 __construct (private ThreadSafeLogger $logger, private int $id, private int $memoryLimit, private SleeperHandlerEntry $sleeperEntry)
 
 getAsyncWorkerId ()
 
 getFromThreadStore (string $identifier)
 
 getLogger ()
 
 getThreadName ()
 
 removeFromThreadStore (string $identifier)
 
 saveToThreadStore (string $identifier, mixed $value)
 

Static Public Member Functions

static getNotifier ()
 

Protected Member Functions

 onRun ()
 

Detailed Description

Definition at line 35 of file AsyncWorker.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\scheduler\AsyncWorker::__construct ( private ThreadSafeLogger $logger,
private int $id,
private int $memoryLimit,
private SleeperHandlerEntry $sleeperEntry )

Definition at line 41 of file AsyncWorker.php.

Member Function Documentation

◆ getAsyncWorkerId()

pocketmine\scheduler\AsyncWorker::getAsyncWorkerId ( )

Definition at line 79 of file AsyncWorker.php.

◆ getFromThreadStore()

pocketmine\scheduler\AsyncWorker::getFromThreadStore ( string $identifier)

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.

Deprecated
Use static class properties instead.

Definition at line 106 of file AsyncWorker.php.

◆ getLogger()

pocketmine\scheduler\AsyncWorker::getLogger ( )

Definition at line 71 of file AsyncWorker.php.

◆ getNotifier()

static pocketmine\scheduler\AsyncWorker::getNotifier ( )
static

Definition at line 48 of file AsyncWorker.php.

◆ getThreadName()

pocketmine\scheduler\AsyncWorker::getThreadName ( )

Definition at line 75 of file AsyncWorker.php.

◆ onRun()

pocketmine\scheduler\AsyncWorker::onRun ( )
protected

Definition at line 55 of file AsyncWorker.php.

◆ removeFromThreadStore()

pocketmine\scheduler\AsyncWorker::removeFromThreadStore ( string $identifier)

Removes previously-stored mixed data from the worker's thread-local object store.

Deprecated
Use static class properties instead.

Definition at line 118 of file AsyncWorker.php.

◆ saveToThreadStore()

pocketmine\scheduler\AsyncWorker::saveToThreadStore ( string $identifier,
mixed $value )

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.

Deprecated
Use static class properties instead.

Definition at line 89 of file AsyncWorker.php.


The documentation for this class was generated from the following file: