private function handleRequest(ServerRequestInterface $request) : ResponseInterface
    {
        $this->eventDispatcher->dispatch(new EventBeforeAppHandlingRequest($request));
        
        $routerMatch = $this->matchRoute($request);
        $stack = $this->getFullMiddlewareStack($request, $routerMatch);
        
        $this->eventDispatcher->dispatch(new EventBeforeAppMiddlewareFullStackDispatching($stack));
        $this->middlewareDispatcher->init($stack);
        $response = $this->middlewareDispatcher->process($request);
        $this->eventDispatcher->dispatch(new EventAfterAppMiddlewareFullStackDispatching($response));
        
        $this->eventDispatcher->dispatch(new EventAfterAppHandlingRequest($response));
        return $response;
    }