protected function write($data, int $seconds = 0): bool
    {
        if (!$data) {
            return false;
        }

        $this->clean();

        $data = $this->pack($data, $seconds);

        $id = shmop_open($this->id, "n", $this->mode, strlen($data));
        if (!$id) {
            return false;
        }

        $size = shmop_write($id, $data, 0);

        return !empty($size);
    }