"onRequest" listener.

@param \Swoole\Http\Request $swooleRequest
@param \Swoole\Http\Response $swooleResponse
190735
public function onRequest($swooleRequest, $swooleResponse)
    {
        $this->app->make('events')->dispatch('swoole.request');

        $this->resetOnRequest();
        $sandbox = $this->app->make(Sandbox::class);
        $handleStatic = $this->container->make('config')->get('swoole_http.handle_static_files', true);
        $publicPath = $this->container->make('config')->get('swoole_http.server.public_path', base_path('public'));

        try {
            // handle static file request first
            if ($handleStatic && Request::handleStatic($swooleRequest, $swooleResponse, $publicPath)) {
                return;
            }
            // transform swoole request to illuminate request
            $illuminateRequest = Request::make($swooleRequest)->toIlluminate();

            // set current request to sandbox
            $sandbox->setRequest($illuminateRequest);

            // enable sandbox
            $sandbox->enable();

            // handle request via laravel/lumen's dispatcher
            $illuminateResponse = $sandbox->run($illuminateRequest);

            // send response
            Response::make($illuminateResponse, $swooleResponse)->send();
        } catch (Throwable $e) {
            try {
                $exceptionResponse = $this->app
                    ->make(ExceptionHandler::class)
                    ->render(
                        $illuminateRequest,
                        $this->normalizeException($e)
                    );
                Response::make($exceptionResponse, $swooleResponse)->send();
            } catch (Throwable $e) {
                $this->logServerError($e);
            }
        } finally {
            // disable and recycle sandbox resource
            $sandbox->disable();
        }
    }
317563
protected function doRequest(RequestInterface $httpRequest)
    {
        $httpRawResponse = $httpRequest->execute();
        $httpStatusCode = $httpRequest->getInfo(CURLINFO_HTTP_CODE);
        $httpRequest->close();

        return $this->buildResponse($httpStatusCode, $httpRawResponse);
    }
916694
public void notifyObserversOfRequestAdded(CachedSpiceRequest<?> request, Set<RequestListener<?>> requestListeners) {
        RequestProcessingContext requestProcessingContext = new RequestProcessingContext();
        requestProcessingContext.setExecutionThread(Thread.currentThread());
        requestProcessingContext.setRequestListeners(requestListeners);
        post(new RequestAddedNotifier(request, spiceServiceListenerList, requestProcessingContext));
    }
1219232
function onResponse( response ) {
		res = response;
		if ( res.statusCode !== 200 ) {
			err = {
				'status': res.statusCode,
				'message': ''
			};
		}
		debug( 'Received a response from query endpoint.' );
		debug( 'Response status: %s.', res.statusCode );

		debug( 'Response headers: %s', JSON.stringify( res.headers ) );

		res.setEncoding( 'utf8' );
		res.on( 'data', onData );
		res.on( 'end', onEnd );
	}
963389
function parseCookie(Swoole\Request $request)
    {
        $request->cookie = self::parseParams($request->header['Cookie']);
    }
1194312
function onWebSocketRequest(Swoole\Request $request)
    {
        $response = $this->currentResponse = new Swoole\Response();
        $this->doHandshake($request, $response);
        return $response;
    }
692876
function onTimer($timerId)
    {
        $now = time();
        //echo "timer $interval\n";
        foreach ($this->wait_requests as $id => $request)
        {
            if ($request->time < $now - $this->request_timeout)
            {
                $response = new Swoole\Response;
                $response->setHeader('Access-Control-Allow-Origin', $this->origin);
                $response->body = json_encode(array('success' => 0, 'text' => 'timeout'));
                $this->response($request, $response);
                unset($this->wait_requests[$id]);
            }
        }
    }
806049
public function withSwooleResponse(SwooleResponse $swResponse): self
    {
        if ($this->swResponse === $swResponse) {
            return $this;
        }

        $clone = clone $this;
        $clone->swResponse = $swResponse;

        return $clone;
    }
242852
private function transformServerRequest(\swoole_http_request $swooleRequest)
    {
        return $this->psr7Factory->createServerRequest(
            $this->transformServerParams($swooleRequest),
            $this->transformUpladedFiles($swooleRequest),
            $this->transformUri($swooleRequest),
            $this->transformRequestMethod($swooleRequest),
            $this->transformBody($swooleRequest),
            $this->transformHeader($swooleRequest)
        )
            ->withParsedBody(isset($swooleRequest->post) ? $swooleRequest->post : null)
            ->withCookieParams($this->transformCookies($swooleRequest))
            ->withProtocolVersion($this->transformProtocolVersion($swooleRequest))
        ;
    }
753851
public function transform(\swoole_http_request $swooleRequest)
    {
        return $this->useServerRequest ?
            $this->transformServerRequest($swooleRequest) : $this->transformRequest($swooleRequest);
    }
658764
public function onKernelRequest(GetResponseEvent $event): void
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $attributes = $event->getRequest()->attributes;
        if ($attributes->get(SetIsApiRequestListener::API_FLAG_NAME) !== true) {
            return;
        }

        if (!$attributes->has('itemType')) {
            return;
        }

        $backend = $this->backendRegistry->getBackend($attributes->get('itemType'));
        $this->container->set('netgen_content_browser.current_backend', $backend);
    }
812979
public function callMiddlewareStack(ServerRequestInterface $request, ResponseInterface $response)
    {

        if (!$this->tip) {
            $this->seedMiddlewareStack();
        }

        $this->deferredBefore = new \SplObjectStorage();
        $this->deferredAfter  = new \SplObjectStorage();

        $this->callableStackBefore->rewind();
        $this->callableStackAfter->rewind();
    
        $before = null;

        if (!$this->callableStackBefore->isEmpty()) {
            $before = $this->callableStackBefore->dequeue();
        }
        
        $after = null;

        if (!$this->callableStackAfter->isEmpty()) {
            $after = $this->callableStackAfter->dequeue();
        }

        $this->middlewareLock = true;

        if ($before) {
            list ($request, $response) = $before($request, $response);
        }
        
        $response = call_user_func($this->tip, $request, $response);
        
        //
        if ($after) {
            list ($request, $response) = $after($request, $response);
        }
        
        $this->middlewareLock = false;

        return $response;
    }
539536
protected void notifyRequestListeners(RequestNotifierAction action, HttpServletRequest req, HttpServletResponse resp) throws IOException {
		// notify any listeners that the config has been updated
		IServiceReference[] refs = null;
		try {
			refs = getPlatformServices().getServiceReferences(IRequestListener.class.getName(),  "(name="+getName()+")"); //$NON-NLS-1$ //$NON-NLS-2$
		} catch (PlatformServicesException e) {
			if (log.isLoggable(Level.SEVERE)) {
				log.log(Level.SEVERE, e.getMessage(), e);
			}
		}
		if (refs != null) {
			for (IServiceReference ref : refs) {
				IRequestListener listener = (IRequestListener)getPlatformServices().getService(ref);
				try {
					if (action == RequestNotifierAction.start) {
						listener.startRequest(req, resp);
					} else {
						listener.endRequest(req, resp);
					}
				} finally {
					getPlatformServices().ungetService(ref);
				}
			}
		}
	}
323549
public function onKernelRequest(GetResponseEvent $event)
    {
        $headers = $event->getRequest()->headers;

        if (!$headers->has(self::HEADER_NAME)) {
            return;
        }

        $this->requestId->set($headers->get(self::HEADER_NAME, null, true), true);
    }
1063060
public function onKernelResponse(FilterResponseEvent $event)
    {
        if ($this->handleResponse && $this->http_code !== null) {
            $response = $event->getResponse();
            $response->setStatusCode($this->http_code, $this->http_status);
        }
    }
128866
private function handleRequest(RequestInterface $request, ResponseInterface $response): void
    {
        foreach ($this->routes as $route) {
            $routeMatch = $route->matches($request);

            if ($routeMatch === null) {
                continue;
            }

            $controllerClass = $routeMatch->getControllerClassName();
            $controller = new $controllerClass();

            /** @var ControllerInterface $controller */
            $controller->processRequest($this, $request, $response, $routeMatch->getAction(), $routeMatch->getParameters());

            return;
        }

        $response->setStatusCode(new StatusCode(StatusCode::NOT_FOUND));
    }
243156
public function onKernelException(GetResponseForExceptionEvent $event)
    {
        if (($exception = $event->getException()) instanceof SyntaxErrorException) {
            // Set status code and content
            $response = new Response();
            $response
                ->setStatusCode(Response::HTTP_BAD_REQUEST)
                ->setContent(
                    $this->getSerializedContent(
                        [
                            'message' => sprintf('syntax error in rql: %s', $exception->getMessage())
                        ]
                    )
                );
            $event->setResponse($response);
        }
    }