-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timer::add in master process is impossible ? I think it can be #996
Comments
Hi webrobot1 Workerman support timer in the master process, and the code is similar to this
take care |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At some situation i need add Timer at master process, but it look like imposible because master have
monitorWorkersForLinux
method withpcntl_wait
function what will be block master process until worker will not shutdown or master will get somу signal. While it was blocking no one Event library can't run timer...but...Some Event library has own
pcntl_wait
analogs , likeSwoole\Coroutine\System::wait
in Swoole (https://wiki.swoole.com/#/coroutine/system?id=wait). It will do same things aspcntl_wait
but additional Timer can be work in master processIs it possible change
monitorWorkersForLinux
$pid = \pcntl_wait($status, \WUNTRACED);
->static::$globalEvent->wait()
? And EventInterface need be abstract with share methodwait
by default havepcntl_wait
(except Swoole) and return array['pid'=>$pid, 'signal'=>$status]
(like aSwoole\Coroutine\System::wait
return array's format) or stay like Interface but need have abstract methodwait():array
(but in this realisation each Event needwait
method withpcntl_wait
except Swoole)Because not it impossible change
monitorWorkersForLinux
by extends class , because it have private property , additionaly this method have a lot of code, but only need change one line of code@walkor
The text was updated successfully, but these errors were encountered: