public function onReady() { $conn = $this; $this->keepaliveTimer = setTimeout(function ($timer) use($conn) { $conn->ping(); }, 10000000.0); }