web2all/signal 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

web2all/signal

Composer 安装命令:

composer require web2all/signal

包简介

Web2All signal handling

README 文档

README

This package can be used to easily enable signal handling in your commandline tool or daemon.

What does it do

Catch signals sent to your program and allow you to handle them. By default catch kill -HUP, kill and ctrl-c. It is intended for simple usage so you can gracefully shutdown your program.

Usage

$sh = new Web2All_Signal_Handler();
$sh->pcntlSignalSetup();
while(1){
  // do stuff
  sleep($time);
  // you must call pcntlSignalDispatch regulary (preferably after each sleep)
  // so all signals get handled. Signals will automatically interrupt the
  // php sleep() command.
  $sh->pcntlSignalDispatch();
  if ($sh->pcntlSignalReceived()) break;
}

License

Web2All framework is open-sourced software licensed under the MIT license (https://opensource.org/licenses/MIT).

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固