{@inheritDoc}
@see \Interop\Http\ServerMiddleware\DelegateInterface::process()
545251
public function process(ServerRequestInterface $request)
    {
        if (null === $this->dispatcher) {
            throw new \BadMethodCallException("Middleware stack must first be provided via the init() method.");
        }
        return $this->dispatcher->dispatch($request);
    }
1111921
public function runAsync($blocking = self::NON_BLOCKING)
    {
        if ($this->running) {
            throw new RuntimeException('Process already running.');
        }

        try {
            $this->exec(false, $blocking);
        } catch (ProcessException $ex) {
            throw $ex;
        } catch (Exception $ex) {
            $this->cleanup();
            throw new ProcessException('Unknown process exception.', $this, $ex);
        }

        return $this;
    }
279601
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $serviceHandler = $request->getAttribute(RouterMiddleware::ATTRIBUTE);

        /* @var \Swoft\Rpc\Server\Router\HandlerAdapter $handlerAdapter */
        $handlerAdapter = App::getBean('serviceHandlerAdapter');
        $response       = $handlerAdapter->doHandler($request, $serviceHandler);

        return $response;
    }
687644
public function exec()
    {
        $http = $this->argument('http');
        $controller = $this->argument('controller');
        $method = $this->argument('method');
        //
        $process = Router::target($http, $controller, $method);
        //
        $this->show($process);
    }
712379
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        return $this->pipeline->withRequest($request, function () use ($request, $handler): ResponseInterface {
            return $handler->handle($request);
        });
    }
534786
public function passThroughProcess(Process $process)
    {
        if ($this->output->isVeryVerbose()) {
            $this->output->writeln(sprintf('<bg=blue;fg=white;> RUN </> <fg=blue>%s</>', $process->getCommandLine()));
        }
        $process->run(function ($type, $buffer) {
            $this->output->write($buffer);
        });

        return $process;
    }
300090
public function process()
    {
        $rule = $this->getComponent();
        $context = $this->getContext();

        $processor = $this->getRuleProcessorFactory()->createProcessor($rule);
        $processor->setState($context);
        $processor->process();

        $this->trace($rule->getQtiClassName());
    }
275499
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $processBuilder = ProcessBuilder::create([
            'drush',
            '--root=' . Platform::webDir(),
            '--uri=' . Platform::getUri()
        ]);
        foreach ($input->getArgument('cmd') as $argument) {
            $processBuilder->add($argument);
        }
        foreach ($input->getOption('drush_option') as $option) {
            $processBuilder->add($option);
        }

        if ($output->getVerbosity() > $output::VERBOSITY_NORMAL) {
            $output->writeln('Running drush command: <info>' . $processBuilder->getProcess()->getCommandLine() . '</info>');
        }

        passthru($processBuilder->getProcess()->getCommandLine());
    }
810431
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
    {
        $operation = $this->getOperation($request);

        $arguments = [];
        foreach ($operation->getParameters() as $parameter) {
            $arguments[] = $request->getAttribute($parameter->getName());
        }

        $result = call_user_func_array($this->commands[$operation->getId()], $arguments);

        return $delegate->process($request->withAttribute(self::ATTRIBUTE, $result));
    }
455441
public function process(HTTPRequest $request, callable $delegate)
    {
        /** @var HTTPResponse $response */
        $response = $delegate($request);

        // Ignore by regexes.
        if ($this->shouldCheckHttpHost() && $this->isIgnoredDomain($_SERVER['HTTP_HOST'])) {
            return $response;
        }

        foreach ($this->requestedPolicies as $requestedPolicy) {
            /** @var ControllerPolicy $policyInstance */
            $policyInstance = $requestedPolicy['policy'];

            $policyInstance->applyToResponse(
                $requestedPolicy['originator'],
                $request,
                $response
            );
        }

        return $response;
    }
1055800
public function runAsProcessReturningProcessObject(string $command) : Process
    {
        $process = new Process($command);
        $process->run();
        $process->setTimeout(null);
        $process->setIdleTimeout(60);
        $process->wait();

        return $process;
    }
7627
public function process(ServerRequestInterface $request, DelegateInterface $delegate)
    {
        $uriPath = $request->getUri()->getPath();

        /** @var Description $description */
        foreach ($this->repository as $description) {

            $basePath = $description->getBasePath() ? "{$description->getBasePath()}/" : "";

            foreach ($description->getPaths() as $path) {
                $pathPattern = "$basePath{$path->getPath()}";

                $parameterNames = [];
                foreach ($path->getOperations() as $operation) {
                    foreach ($operation->getParameters() as $parameter) {
                        if ($parameter->getIn() === Parameter::IN_PATH
                            && ($schema = $parameter->getSchema()) instanceof ScalarSchema
                        ) {
                            $parameterName    = $parameter->getName();
                            $parameterNames[] = $parameterName;
                            $typePattern      = $this->typePatternResolver->resolve($schema);
                            $parameterPattern = "(?P<$parameterName>$typePattern)(?=(/|$))";
                            $pathPattern      = str_replace('{' . $parameterName . '}', $parameterPattern, $pathPattern);
                        }
                    }

                    if (preg_match("#^$pathPattern$#", $uriPath, $matches) > 0) {
                        if (strtolower($request->getMethod()) !== $operation->getMethod()) {
                            return Factory::createResponse(405);
                        }

                        $request = Meta::requestWith($request, $description, $operation, $path);

                        foreach ($parameterNames as $parameterName) {
                            $request = $request->withAttribute($parameterName, $matches[$parameterName]);
                        }

                        return $delegate->process($request);
                    }
                }

            }
        }

        return Factory::createResponse(404);
    }
573006
public function runInteractive($blocking = self::NON_BLOCKING)
    {
        if ($this->running) {
            throw new RuntimeException('Process already running.');
        }

        try {
            $this->exec(true, $blocking);
        } catch (ProcessException $ex) {
            throw $ex;
        } catch (Exception $ex) {
            $this->cleanup();
            throw new ProcessException('Unknown process exception.', $this, $ex);
        }

        return $this;
    }
59407
public function add($process)
    {
        if (is_array($process)) {
            foreach ($process as $p) {
                $this->add($p);
            }
        } elseif (!$process instanceof ChainProcessInterface) {
            throw new \RuntimeException(sprintf(
                'Expect to be instance of ChainProcessInterface or array but got %s',
                get_class($process)
            ));
        } else {
            $this->processes[] = $process;
        }
    }
474177
public function process(Request $request, RequestHandlerInterface $delegate): ResponseInterface
    {
        try {
            return $delegate->handle($request);
        } catch (\Throwable $t) {
            return $this->handleException($t, $request);
        }
    }
838615
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $result = $this->router->dispatch(
            $request->getMethod(),
            $request->getUri()->getPath()
        );

        return $handler->handle(
            $request->withAttribute('routing', $result)
        );
    }
15286
private function composeProcess(string $command): Process
    {
        if ($this->process === null) {
            $this->process = new Process([$command]);
        }

        $this->process->inheritEnvironmentVariables();
        $this->process->setTimeout($this->timeout);
        $this->process->setCommandLine($command);

        return $this->process;
    }