private function readStreams(\Closure $callback = null): void
    {
        $stdOut = $this->readOutput(self::STDOUT);
        $stdErr = $this->readOutput(self::STDERR);

        $this->fullStdOut .= $stdOut;
        $this->fullStdErr .= $stdErr;

        if (!is_null($callback)) {
            $callback($stdOut, $stdErr);
        }

        $this->observer->stdOutRead($this->pid, $stdOut);
        $this->observer->stdErrRead($this->pid, $stdErr);
    }