add api docs (#80)

This commit is contained in:
sunxyw
2022-03-27 16:42:36 +08:00
committed by GitHub
parent 5ddc514545
commit 4fbe2aa5af
147 changed files with 6425 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
# ZM\Utils\Manager\CronManager
## initCronTasks
```php
public function initCronTasks(): mixed
```
### 描述
初始化 Cron 注解
必须在 WorkerStart 事件中调用
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |
## startExecute
```php
public function startExecute(ZM\Annotation\Cron\Cron $v, ZM\Event\EventDispatcher $dispatcher, Cron\CronExpression $cron): mixed
```
### 描述
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| v | ZM\Annotation\Cron\Cron | |
| dispatcher | ZM\Event\EventDispatcher | |
| cron | Cron\CronExpression | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |

View File

@@ -0,0 +1,62 @@
# ZM\Utils\Manager\ModuleManager
## getConfiguredModules
```php
public function getConfiguredModules(): array
```
### 描述
扫描src目录下的所有已经被标注的模块
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| array | |
## packModule
```php
public function packModule(mixed $module): bool
```
### 描述
打包模块
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| module | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| bool | |
## unpackModule
```php
public function unpackModule(mixed $module, array $options): array|false
```
### 描述
解包模块
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| module | mixed | |
| options | array | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| array|false | |

View File

@@ -0,0 +1 @@
# ZM\Utils\Manager\ProcessManager

View File

@@ -0,0 +1 @@
# ZM\Utils\Manager\RouteManager

View File

@@ -0,0 +1 @@
# ZM\Utils\Manager\TaskManager

View File

@@ -0,0 +1,64 @@
# ZM\Utils\Manager\WorkerManager
## workerAction
```php
public function workerAction(mixed $src_worker_id, mixed $data): mixed
```
### 描述
Worker 进程间通信触发的动作类型函数
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| src_worker_id | mixed | |
| data | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |
## sendActionToWorker
```php
public function sendActionToWorker(mixed $worker_id, mixed $action, mixed $data): mixed
```
### 描述
给 Worker 进程发送动作指令(包括自身,自身将直接执行)
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| worker_id | mixed | |
| action | mixed | |
| data | mixed | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |
## resumeAllWorkerCoroutines
```php
public function resumeAllWorkerCoroutines(): mixed
```
### 描述
向所有 Worker 进程发送动作指令
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |