data = $stream->buffer; $this->level = $compressionLevel; $this->storeLocal($targets); } public function onRun() : void{ $this->setResult(NetworkCompression::compress($this->data, $this->level), false); } public function onCompletion(Server $server) : void{ /** @var Player[] $targets */ $targets = $this->fetchLocal(); $server->broadcastPacketsCallback($this->getResult(), $targets); } }