在webman的自定义命令中 使用用高速共享缓存插件时报错

windss

问题描述

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;
    }
}

截图报错信息里报错文件相关代码

操作系统及workerman/webman等框架组件具体版本

webman 和 高速共享缓存 最新版本

220 0 0
0个回答

×
🔝