Describe the bug
PHP Fatal error: Swoole\Coroutine\Channel::push(): must be called in the coroutine. in /home/swoft-study/integrating/vendor/swoft/connection-pool/src/AbstractPool.php on line 271
namespace App\Listener;
use Exception;
use Swoft\Event\Annotation\Mapping\Listener;
use Swoft\Event\EventHandlerInterface;
use Swoft\Event\EventInterface;
use Swoft\Server\ServerEvent;
/**
* Class RegisterServer
* @package App\Listener
* @Listener(ServerEvent::BEFORE_START)
*/
class RegisterServer implements EventHandlerInterface
{
public function handle(EventInterface $event): void
{
$redisCon = bean('redis.pool')->getConnection();
$redisCon->setRelease(true); //设置连接可以重用
echo ($redisCon->hset("integrating_message_job", 'haha', 0));
echo 'dfsdfs';
$redisCon->release($redisCon);
exit
}
swoft版本2.0.1
Describe the bug PHP Fatal error: Swoole\Coroutine\Channel::push(): must be called in the coroutine. in /home/swoft-study/integrating/vendor/swoft/connection-pool/src/AbstractPool.php on line 271