public function start()
    {
        header('Content-Type: text/event-stream');
        header('Cache-Control: no-cache');
        header('Access-Control-Allow-Origin: *');
    
        if (isset($_SERVER['HTTP_LAST_EVENT_ID'])) {
            $this->lastId = intval($_SERVER['HTTP_LAST_EVENT_ID']);
        } elseif (isset($_GET['lastEventId'])) {
                  $this->lastId = intval($_GET['lastEventId']);
        }
    
        if ($this->padding > 0) {
            $this->putLine(':' . str_repeat(' ', $this->padding));
        }
        $this->putLine('retry: ' . $this->retry);
        $this->flush();
    }