AsyncTask: regroup some methods into more sensible places

how the fuck is anyone supposed to find anything??
This commit is contained in:
Dylan K. Taylor 2021-08-20 20:16:59 +01:00
parent eb9188c309
commit f5a4baf3cf
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -104,6 +104,10 @@ abstract class AsyncTask extends \Threaded{
return $this->finished or $this->isCrashed(); return $this->finished or $this->isCrashed();
} }
public function hasResult() : bool{
return $this->result !== null;
}
/** /**
* @return mixed * @return mixed
*/ */
@ -115,18 +119,6 @@ abstract class AsyncTask extends \Threaded{
return $this->result; 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 * @param mixed $result
*/ */
@ -134,6 +126,13 @@ abstract class AsyncTask extends \Threaded{
$this->result = ($this->serialized = !is_scalar($result)) ? igbinary_serialize($result) : $result; $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{ public function setSubmitted() : void{
$this->submitted = true; $this->submitted = true;
} }