public function listen(callable $finalHandler = null)
    {
        $callback = $this->callback;

        ob_start();
        $bufferLevel = ob_get_level();

        $response = $callback($this->request, $this->response, $finalHandler);
        if (! $response instanceof ResponseInterface) {
            $response = $this->response;
        }
        $this->getEmitter()->emit($response, $bufferLevel);
    }