Clarified that AsyncTask should not run for a long time

This commit is contained in:
SOFe 2016-11-13 18:14:41 +08:00
parent 75fa2f1132
commit ab4d6b1e36
No known key found for this signature in database
GPG Key ID: A0379676C4D9D5D9

View File

@ -27,6 +27,10 @@ use pocketmine\Server;
/**
* Class used to run async tasks in other threads.
*
* An AsyncTask does not have its own thread. It is queued into an AsyncPool and executed if there is an async worker
* with no AsyncTask running. Therefore, an AsyncTask SHOULD NOT execute for more than a few seconds. For tasks that
* run for a long time or infinitely, start another {@link \pocketmine\Thread} instead.
*
* WARNING: Do not call PocketMine-MP API methods, or save objects (and arrays cotaining objects) from/on other Threads!!
*/
abstract class AsyncTask extends Collectable{