You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?phpdeclare(strict_types=1);namespace App\TaskWorker;
use Hyperf\Utils\ApplicationContext;use App\Libs\SimpleSSDB;use Hyperf\Task\Annotation\Task;
class SSDBTask{ /** * @var SimpleSSDB */ public $ss = null;
/** * @Task */ public function exec($method,...$args) { $result = $this->client()->__call($method,$args);
return $result; }
public function execWithoutTask($method,...$args) { $result = $this->client()->__call($method,$args);
return $result; }
protected function client(){ if ($this->ss instanceof SimpleSSDB) { return $this->ss; }
$this->ss = new SimpleSSDB(env('SSDB_HOST'), env('SSDB_PORT')); $this->ss->auth(env('SSDB_AUTH'));
return $this->ss;
}}
|