\pcntl_signal_dispatch(); } } 开发者ID:amphp,项目名称:loop,代码行数:32,代码来源:NativeLoop.php 示例4: startWorker ▲点赞 1▼ /** * run the worker */protectedfunctionstartWorker(){ $run_count =0;while(!$this->stop_work) {pcntl_signal_dispatch();try{$this->_do(); }catch(Except...
函数pcntl_signal_dispatch()调用每个等待信号通过pcntl_signal()安装的处理器。返回值成功时返回 TRUE, 或者在失败时返回 FALSE。范例Example #1 pcntl_signal_dispatch() 示例<?php echo "安装信号处理器...\n"; pcntl_signal(SIGHUP, function($signo) { echo "信号处理器被调用\n"; }); echo "为自己...
The solution seems to be to explicitly call pcntl_signal_dispatch()inside a ticks_handler() . And use sig_handler(int) as a push function to a queue. Immediately following the call to dispatch in the ticks_handler, pop your queue doing what you would have done in the signal_handler unti...
Example #1 pcntl_signal_dispatch() example 代码语言:javascript 复制 <?php echo"Installing signal handler...\n";pcntl_signal(SIGHUP,function($signo){echo"signal handler called\n";});echo"Generating signal SIGHUP to self...\n";posix_kill(posix_getpid(),SIGHUP);echo"Dispatching...\n";pcn...