mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added settings.async-workers to tune the amount of AsyncTask workers
This commit is contained in:
@ -24,13 +24,10 @@ namespace pocketmine\scheduler;
|
||||
class AsyncWorker extends \Worker{
|
||||
public $path;
|
||||
|
||||
public function __construct(){
|
||||
public function start($options = PTHREADS_INHERIT_ALL){
|
||||
$this->path = \pocketmine\PATH;
|
||||
return parent::start(PTHREADS_INHERIT_ALL & ~PTHREADS_INHERIT_CLASSES);
|
||||
}
|
||||
|
||||
public function start(){
|
||||
|
||||
return parent::start($options & ~PTHREADS_INHERIT_CLASSES);
|
||||
}
|
||||
|
||||
public function run(){
|
||||
|
@ -28,7 +28,7 @@ use pocketmine\plugin\Plugin;
|
||||
use pocketmine\utils\ReversePriorityQueue;
|
||||
|
||||
class ServerScheduler{
|
||||
protected static $WORKERS = 3;
|
||||
public static $WORKERS = 3;
|
||||
/**
|
||||
* @var ReversePriorityQueue<Task>
|
||||
*/
|
||||
|
Reference in New Issue
Block a user