不支持 定时器,这样调用。结束内存超出的进程失败。
Timer::add(60, [$this, 'checkMemory'], [$memoryLimit]);
public function repeat(float $interval, callable $func, array $args = []): int
{
$className = $this->eventClassName;
$timerId = $this->timerId++;
$event = new $className($this->eventBase, -1, $className::TIMEOUT | $className::PERSIST, $func);
if (!$event->addTimer($interval)) {
throw new \RuntimeException("Event::addTimer($interval) failed");
}
$this->eventTimer[$timerId] = $event;
return $timerId;
}
不支持
Timer::add(60, [$this, 'checkMemory'], [$memoryLimit]);
webman v1.6.14 / workerman v5.0.0
linux php 安装 php8.3 event扩展