Download the PHP package pagon/childprocess without Composer
On this page you can find all versions of the php package pagon/childprocess. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download pagon/childprocess
More information about pagon/childprocess
Files in pagon/childprocess
Download pagon/childprocess
More information about pagon/childprocess
Files in pagon/childprocess
Please rate this library. Is it a good library?
Informations about the package childprocess
其它语言:English
PHP-ChildProcess
一个CLI下易用简单的管理进程的库
安装
添加 "pagon/childprocess": "*" 到 composer.json:
目录
- 使用管理器
- 创建子进程
- 自动运行
- 手动运行
- 手动运行等待
- 运行PHP文件
- 运行命令
- 其它
- 发送消息
- 高级用法
- 事件
- ChildProcess
- Process
使用
使用管理器
控制当前进程
创建子进程
简单运行
在子平行空间运行闭包函数
为了保证主进程不退出来handle事件,可以使用
join或者while(1)来保证运行
手动运行
手动运行等待
运行PHP文件
在子平行空间运行PHP文件
主进程:
PHP文件:
运行命令
在子进程运行命令,并且捕获输出
其它
发送消息
父子进程可以使用消息来通信
高级用法
设置选项
当前支持的选项列表:
一些用法:
事件
ChildProcess事件
tick每个tick都会触发,主要用于监控一些行为来及时反馈到管理器listen监听消息队列signal收到任何的信号abort中断时:SIGINT,SIGTERMfinish运行结束时(正常退出)exit管理器进程退出,包含abort和finish
Process事件
listen当前进程实例开始监听队列时触发run当前进程实例手动运行时init当前进程实例子进程创建完成时fork当前进程实例fork时abort当前进程实例中断时:SIGINT,SIGTERMfinish当前进程实例结束时(正常退出)exit当前进程实例退出时,包含abort和finish
授权
MIT
All versions of childprocess with dependencies
PHP Build Version
Package Version
The package pagon/childprocess contains the following files
Loading the files please wait ...