Свойство | Type | Description | |
---|---|---|---|
$instance |
Свойство | Type | Description | |
---|---|---|---|
$_maxManagerPidLength | |||
$_maxMasterPidLength | integer | MasterPid命令时格式化输出 ManagerPid命令时格式化输出 WorkerId命令时格式化输出 WorkerPid命令时格式化输出 | |
$_maxWorkerIdLength | |||
$_maxWorkerPidLength | |||
$handleProviderPort | |||
$handleWorkerPort | |||
$logBuffer | string | 日志的buffer | |
$logDir | string | 存放统计日志的目录 | |
$masterPidPath | string | master pid path | |
$statisticData | array | 统计数据 ip=>modid=>interface=>['code'=>[xx=>count,xx=>count],'suc_cost_time'=>xx,'fail_cost_time'=>xx, 'suc_count'=>xx, 'fail_count'=>xx] | |
$statisticDir | string | 存放统计数据的目录 | |
$udpFinderport |
Méthode | Description | |
---|---|---|
__construct ( ) | ||
clearDisk ( string $file = null, integer $exp_time = 86400 ) | 清除磁盘数据 | |
decode ( unknown $buffer ) : mixed | 解包 | |
getRedis ( ) : unknown | 返回redis链接资源 | |
log ( unknown $msg ) | 日志 | |
onClose ( unknown $serv, unknown $fd, unknown $from_id ) | 链接断开 | |
onConnect ( swoole_server $serv, unknown $fd, unknown $from_id ) | 建立链接 | |
onFinish ( swoole_server $serv, unknown $task_id, unknown $data ) | task执行完毕调用 | |
onReceive ( swoole_server $serv, unknown $fd, unknown $from_id, unknown $data ) | 接收数据 | |
onShutdown ( unknown $serv ) | 关闭服务器 | |
onStart ( swoole_server $serv ) | swoole_start 回调函数 | |
onTask ( swoole_server $serv, unknown $task_id, unknown $from_id, unknown $data ) : void | multitype:string | task任务 | |
onWorkerError ( swoole_server $serv, unknown $worker_id, unknown $worker_pid, unknown $exit_code ) | worker出现问题调用 | |
onWorkerStart ( unknown $serv, unknown $worker_id ) | 进程启动 | |
onWorkerStop ( unknown $serv, unknown $worker_id ) | 关闭进程 | |
processRename ( unknown $serv, unknown $worker_id ) | 修改进程名 | |
run ( $ip = "0.0.0.0", $port = 55656, $mode = SWOOLE_PROCESS, $type = SWOOLE_SOCK_TCP ) | ||
writeLogToDisk ( ) : void | 将日志数据写入磁盘 | |
writeStatisticsToDisk ( ) : void | 将统计数据写入磁盘 |
Méthode | Description | |
---|---|---|
collectStatistics ( string $module, string $interface, float $cost_time, integer $success, string $ip, integer $code, string $msg ) : void | 收集统计数据 |
public onClose ( unknown $serv, unknown $fd, unknown $from_id ) | ||
$serv | unknown | |
$fd | unknown | |
$from_id | unknown |
public onConnect ( swoole_server $serv, unknown $fd, unknown $from_id ) | ||
$serv | swoole_server | |
$fd | unknown | |
$from_id | unknown |
public onFinish ( swoole_server $serv, unknown $task_id, unknown $data ) | ||
$serv | swoole_server | |
$task_id | unknown | |
$data | unknown |
public onReceive ( swoole_server $serv, unknown $fd, unknown $from_id, unknown $data ) | ||
$serv | swoole_server | |
$fd | unknown | |
$from_id | unknown | |
$data | unknown |
public onStart ( swoole_server $serv ) | ||
$serv | swoole_server |
public onWorkerError ( swoole_server $serv, unknown $worker_id, unknown $worker_pid, unknown $exit_code ) | ||
$serv | swoole_server | |
$worker_id | unknown | |
$worker_pid | unknown | |
$exit_code | unknown |
public onWorkerStart ( unknown $serv, unknown $worker_id ) | ||
$serv | unknown | |
$worker_id | unknown |
public onWorkerStop ( unknown $serv, unknown $worker_id ) | ||
$serv | unknown | |
$worker_id | unknown |
public processRename ( unknown $serv, unknown $worker_id ) | ||
$serv | unknown | |
$worker_id | unknown |
public run ( $ip = "0.0.0.0", $port = 55656, $mode = SWOOLE_PROCESS, $type = SWOOLE_SOCK_TCP ) |
public writeStatisticsToDisk ( ) : void | ||
Résultat | void |
protected static int $_maxMasterPidLength | ||
Résultat | integer |
protected string $masterPidPath | ||
Résultat | string |
protected array $statisticData | ||
Résultat | array |