forked from kalons/kalondaemon
-
Notifications
You must be signed in to change notification settings - Fork 0
itfoxnet/kalondaemon
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
USAGE: [root@localhost ~]# php test.php start Daemon started with pid xxx... Stop flag is 0 Stop flag is 0 Stop flag is 0 Stop flag is 1 ("php test.php stop" executed in another shell, process with id xxx stopped) 基本原理就是cli模式下执行php test.php start之后其会成为一个后台守护进程,进程号为xxx,守护进程主逻辑是一个死循环,不断的输出 stop flag的值,然后睡眠5秒。当系统接收到php test.php stop命令之后,会给守护进程发送一个信号,守护进程收到信号之后会将Stop flag 设置成1,然后主循环就会终止,守护进程退出。 可以据此守护模型扩展开发PHP后台服务,PHP多进程任务等等。
About
php daemon
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published