Fatal error: Uncaught Error: Call to undefined method React\EventLoop\Timer\Timer::cancel()
if (!isset($this->loop_timer)) {
$this->loop_timer = $this->loop->addPeriodicTimer($this->timeout, function() {
$this->run();
if (!($this->client->run() || $this->client->has())) {
$this->loop_timer->cancel();
$this->loop_timer = null;
}
});
}