mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Improve documentation of Thread and Worker
This commit is contained in:
@ -26,7 +26,14 @@ namespace pocketmine\thread;
|
||||
use const PTHREADS_INHERIT_NONE;
|
||||
|
||||
/**
|
||||
* This class must be extended by all custom threading classes
|
||||
* Specialized Worker class for PocketMine-MP-related use cases. It handles setting up autoloading and error handling.
|
||||
*
|
||||
* Workers are a special type of thread which execute tasks passed to them during their lifetime. Since creating a new
|
||||
* thread has a high resource cost, workers can be kept around and reused for lots of short-lived tasks.
|
||||
*
|
||||
* As a plugin developer, you'll rarely (if ever) actually need to use this class directly.
|
||||
* If you want to run tasks on other CPU cores, check out AsyncTask first.
|
||||
* @see AsyncTask
|
||||
*/
|
||||
abstract class Worker extends \Worker{
|
||||
use CommonThreadPartsTrait;
|
||||
|
Reference in New Issue
Block a user