src/Leevel/Protocol/Server.php
public function process(string $process): void
    {
        $newProgress = new Process(
            function (Process $worker) use ($process) {
                $newProgress = $this->container->make($process);

                if (!is_object($newProgress) || ($newProgress instanceof ProtocolProcess)) {
                    throw new InvalidArgumentException(
                        sprintf('Process `%s` was invalid.', $process)
                    );
                }

                if (!is_callable([$newProgress, 'handle'])) {
                    throw new InvalidArgumentException(
                        sprintf('The `handle` of process `%s` was not found.', $process)
                    );
                }

                $worker->name($this->option['process_name'].'.'.$newProgress->getName());

                $newProgress->handle($this, $worker);
            }
        );

        $this->server->addProcess($newProgress);
    }
public function process(string $process): void
    {
        $newProgress = new Process(
            function (Process $worker) use ($process) {
                $newProgress = $this->container->make($process);

                if (!is_object($newProgress) || ($newProgress instanceof ProtocolProcess)) {
                    throw new InvalidArgumentException(
                        sprintf('Process `%s` was invalid.', $process)
                    );
                }

                if (!is_callable([$newProgress, 'handle'])) {
                    throw new InvalidArgumentException(
                        sprintf('The `handle` of process `%s` was not found.', $process)
                    );
                }

                $worker->name($this->option['process_name'].'.'.$newProgress->getName());

                $newProgress->handle($this, $worker);
            }
        );

        $this->server->addProcess($newProgress);
    }
添加自定义进程.

@param string $process