PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\scheduler\AsyncTask Class Reference
+ Inheritance diagram for pocketmine\scheduler\AsyncTask:
+ Collaboration diagram for pocketmine\scheduler\AsyncTask:

Public Member Functions

 run ()
 
 isFinished ()
 
 getResult ()
 
 hasResult ()
 
 setResult ($result)
 
 setTaskId ($taskId)
 
 getTaskId ()
 
 onRun ()
 
 onCompletion (Server $server)
 

Detailed Description

Class used to run async tasks in other threads.

WARNING: Do not call PocketMine-MP API methods, or save objects from/on other Threads!!

Definition at line 31 of file AsyncTask.php.

Member Function Documentation

pocketmine\scheduler\AsyncTask::getResult ( )
Returns
mixed

Definition at line 55 of file AsyncTask.php.

pocketmine\scheduler\AsyncTask::hasResult ( )
Returns
bool

Definition at line 62 of file AsyncTask.php.

pocketmine\scheduler\AsyncTask::isFinished ( )
Returns
bool

Definition at line 48 of file AsyncTask.php.

pocketmine\scheduler\AsyncTask::onCompletion ( Server  $server)

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

Parameters
Server$server
Returns
void

Definition at line 96 of file AsyncTask.php.

pocketmine\scheduler\AsyncTask::onRun ( )
abstract

Actions to execute when run

Returns
void
pocketmine\scheduler\AsyncTask::setResult (   $result)
Parameters
mixed$result

Definition at line 69 of file AsyncTask.php.


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