From fd1bc1b8456907e8449087e5550ea08a1fd35e5c Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 21 Dec 2023 12:39:55 +0000 Subject: [PATCH] AsyncWorker: deprecate ThreadStore methods these are inconvenient and don't make any sense. It's far easier and more static-analysis-friendly to just use static properties. --- src/scheduler/AsyncWorker.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scheduler/AsyncWorker.php b/src/scheduler/AsyncWorker.php index 0f05dd896..5fdfb1ebb 100644 --- a/src/scheduler/AsyncWorker.php +++ b/src/scheduler/AsyncWorker.php @@ -83,6 +83,8 @@ class AsyncWorker extends Worker{ /** * Saves mixed data into the worker's thread-local object store. This can be used to store objects which you * want to use on this worker thread from multiple AsyncTasks. + * + * @deprecated Use static class properties instead. */ public function saveToThreadStore(string $identifier, mixed $value) : void{ if(NativeThread::getCurrentThread() !== $this){ @@ -98,6 +100,8 @@ class AsyncWorker extends Worker{ * account for the possibility that what you're trying to retrieve might not exist. * * Objects stored in this storage may ONLY be retrieved while the task is running. + * + * @deprecated Use static class properties instead. */ public function getFromThreadStore(string $identifier) : mixed{ if(NativeThread::getCurrentThread() !== $this){ @@ -108,6 +112,8 @@ class AsyncWorker extends Worker{ /** * Removes previously-stored mixed data from the worker's thread-local object store. + * + * @deprecated Use static class properties instead. */ public function removeFromThreadStore(string $identifier) : void{ if(NativeThread::getCurrentThread() !== $this){