webman中使用高速共享緩存(http://www.wtbis.cn/plugin/133) ,使用webman/console 命令行插件中創(chuàng)建訂閱器,啟動(dòng)時(shí)報(bào)錯(cuò)
<?php
namespace app\command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Workbunny\WebmanSharedCache\Cache;
class Test extends Command {
protected static $defaultName = 'Test';
protected static $defaultDescription = '測試';
protected function configure() {
$this->addArgument('name', InputArgument::OPTIONAL, 'Name description');
}
protected function execute(InputInterface $input,OutputInterface $output):int{
$output->writeln('開始執(zhí)行--start');
Cache::ChCreateListener('test',1,function ($channelKey, $workerId, $message)use($output){
$output->writeln('channel-->start');
});
return 1;
}
}
webman 和 高速共享緩存 最新版本