mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
26 lines
507 B
PHP
26 lines
507 B
PHP
<?php
|
|
|
|
/** @noinspection PhpUnused */
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace ZM\Utils\Manager;
|
|
|
|
use Swoole\Process;
|
|
|
|
class ProcessManager
|
|
{
|
|
/** @var Process[] */
|
|
public static $user_process = [];
|
|
|
|
public static function createUserProcess(string $name, callable $callable): Process
|
|
{
|
|
return self::$user_process[$name] = new Process($callable);
|
|
}
|
|
|
|
public static function getUserProcess(string $string): ?Process
|
|
{
|
|
return self::$user_process[$string] ?? null;
|
|
}
|
|
}
|