webman中使用高速共享缓存(https://www.workerman.net/plugin/133) ,使用webman/console 命令行插件中创建订阅器,启动时报错
<?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('开始执行--start');
Cache::ChCreateListener('test',1,function ($channelKey, $workerId, $message)use($output){
$output->writeln('channel-->start');
});
return 1;
}
}
webman 和 高速共享缓存 最新版本