data = $data; $this->targets = $targets; $this->level = $level; } public function onRun(){ try{ $this->final = zlib_encode($this->data, ZLIB_ENCODING_DEFLATE, $this->level); $this->data = null; }catch(\Throwable $e){ } } public function onCompletion(Server $server){ $server->broadcastPacketsCallback($this->final, (array) $this->targets); } }