From f5a4baf3cfad21ecdfa541215f1797eac3411faf Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 20 Aug 2021 20:16:59 +0100 Subject: [PATCH] AsyncTask: regroup some methods into more sensible places how the fuck is anyone supposed to find anything?? --- src/scheduler/AsyncTask.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/scheduler/AsyncTask.php b/src/scheduler/AsyncTask.php index b58f1fddb..8440eb3e9 100644 --- a/src/scheduler/AsyncTask.php +++ b/src/scheduler/AsyncTask.php @@ -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; }