mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
AsyncTask: regroup some methods into more sensible places
how the fuck is anyone supposed to find anything??
This commit is contained in:
parent
eb9188c309
commit
f5a4baf3cf
@ -104,6 +104,10 @@ abstract class AsyncTask extends \Threaded{
|
||||
return $this->finished or $this->isCrashed();
|
||||
}
|
||||
|
||||
public function hasResult() : bool{
|
||||
return $this->result !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
@ -115,18 +119,6 @@ abstract class AsyncTask extends \Threaded{
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
public function cancelRun() : void{
|
||||
$this->cancelRun = true;
|
||||
}
|
||||
|
||||
public function hasCancelledRun() : bool{
|
||||
return $this->cancelRun;
|
||||
}
|
||||
|
||||
public function hasResult() : bool{
|
||||
return $this->result !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $result
|
||||
*/
|
||||
@ -134,6 +126,13 @@ abstract class AsyncTask extends \Threaded{
|
||||
$this->result = ($this->serialized = !is_scalar($result)) ? igbinary_serialize($result) : $result;
|
||||
}
|
||||
|
||||
public function cancelRun() : void{
|
||||
$this->cancelRun = true;
|
||||
}
|
||||
public function hasCancelledRun() : bool{
|
||||
return $this->cancelRun;
|
||||
}
|
||||
|
||||
public function setSubmitted() : void{
|
||||
$this->submitted = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user