From ab4d6b1e36f4b26bbefa7bcf983e2578a3f048a1 Mon Sep 17 00:00:00 2001 From: SOFe Date: Sun, 13 Nov 2016 18:14:41 +0800 Subject: [PATCH] Clarified that AsyncTask should not run for a long time --- src/pocketmine/scheduler/AsyncTask.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pocketmine/scheduler/AsyncTask.php b/src/pocketmine/scheduler/AsyncTask.php index 86d132387..98d3f8cdc 100644 --- a/src/pocketmine/scheduler/AsyncTask.php +++ b/src/pocketmine/scheduler/AsyncTask.php @@ -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{