public function run(Input $input, OutputInterface $output)
    {
        $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('cgi.run.start', $this->exercise, $input));
        $success = true;
        foreach ($this->exercise->getRequests() as $i => $request) {
            $event = $this->eventDispatcher->dispatch(
                new CgiExecuteEvent('cgi.run.student-execute.pre', $request)
            );
            $process = $this->getProcess($input->getArgument('program'), $event->getRequest());

            $output->writeTitle("Request");
            $output->emptyLine();
            $output->write($this->requestRenderer->renderRequest($request));

            $output->writeTitle("Output");
            $output->emptyLine();
            $process->start();
            $this->eventDispatcher->dispatch(
                new CgiExecuteEvent('cgi.run.student.executing', $request, ['output' => $output])
            );
            $process->wait(function ($outputType, $outputBuffer) use ($output) {
                $output->write($outputBuffer);
            });
            $output->emptyLine();

            if (!$process->isSuccessful()) {
                $success = false;
            }

            $output->lineBreak();
        }
        $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('cgi.run.finish', $this->exercise, $input));
        return $success;
    }