mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
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.
This commit is contained in:
parent
c05116849a
commit
fd1bc1b845
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user