public function receiveRequest(Request $request): Response
    {
        $curie = $request::schema()->getCurie();
        $curieStr = $curie->toString();

        if (isset($this->handlers[$curieStr])) {
            $handler = $this->handlers[$curieStr];
        } else {
            try {
                $handler = $this->locator->getRequestHandler($curie);
            } catch (\Throwable $e) {
                return $this->createResponseForFailedRequest($request, $e);
            }

            $this->handlers[$curieStr] = $handler;
        }

        try {
            $request->freeze();
            $response = $handler->handleRequest($request, $this->locator->getPbjx());
            $response->set('ctx_request_ref', $request->generateMessageRef());
            if ($request->has('ctx_correlator_ref')) {
                $response->set('ctx_correlator_ref', $request->get('ctx_correlator_ref'));
            }

            return $response;
        } catch (\Throwable $e) {
            return $this->createResponseForFailedRequest($request, $e);
        }
    }
public function receiveRequest(Request $request): Response
    {
        $curie = $request::schema()->getCurie();
        $curieStr = $curie->toString();

        if (isset($this->handlers[$curieStr])) {
            $handler = $this->handlers[$curieStr];
        } else {
            try {
                $handler = $this->locator->getRequestHandler($curie);
            } catch (\Throwable $e) {
                return $this->createResponseForFailedRequest($request, $e);
            }

            $this->handlers[$curieStr] = $handler;
        }

        try {
            $request->freeze();
            $response = $handler->handleRequest($request, $this->locator->getPbjx());
            $response->set('ctx_request_ref', $request->generateMessageRef());
            if ($request->has('ctx_correlator_ref')) {
                $response->set('ctx_correlator_ref', $request->get('ctx_correlator_ref'));
            }

            return $response;
        } catch (\Throwable $e) {
            return $this->createResponseForFailedRequest($request, $e);
        }
    }
public function receiveRequest ( Request $ request ) : Response { $ curie = $ request :: schema ( ) -> getCurie ( ) ; $ curieStr = $ curie -> toString ( ) ; if ( isset ( $ this -> handlers [ $ curieStr ] ) ) { $ handler = $ this -> handlers [ $ curieStr ] ; } else { try { $ handler = $ this -> locator -> getRequestHandler ( $ curie ) ; } catch ( \ Throwable $ e ) { return $ this -> createResponseForFailedRequest ( $ request , $ e ) ; } $ this -> handlers [ $ curieStr ] = $ handler ; } try { $ request -> freeze ( ) ; $ response = $ handler -> handleRequest ( $ request , $ this -> locator -> getPbjx ( ) ) ; $ response -> set ( 'ctx_request_ref' , $ request -> generateMessageRef ( ) ) ; if ( $ request -> has ( 'ctx_correlator_ref' ) ) { $ response -> set ( 'ctx_correlator_ref' , $ request -> get ( 'ctx_correlator_ref' ) ) ; } return $ response ; } catch ( \ Throwable $ e ) { return $ this -> createResponseForFailedRequest ( $ request , $ e ) ; } }
Invokes the handler that services the given request.  If an exception occurs
it will be caught and a RequestFailedResponse will be created with the reason.

{@inheritdoc}
Invokes the handler that services the given request . If an exception occurs it will be caught and a RequestFailedResponse will be created with the reason .