不支持 定時(shí)器,這樣調(diào)用。結(jié)束內(nèi)存超出的進(jìn)程失敗。
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擴(kuò)展