vend / php-resque

PHP port of resque (Workers and Queueing)
MIT License
32 stars 9 forks source link

SIGQUIT doesn't always trigger Worker::shutdown() #17

Open teake opened 9 years ago

teake commented 9 years ago

I'm seeing strange behaviour upon sending a SIGQUIT signal to a worker. If the worker is instantiated as follows:

$resque = new \Resque\Resque(<some client>);
$worker = new \Resque\Worker($resque);

then the SIGQUIT doesn't trigger a call to $worker->shutdown(). However, if it is instantiated as follows:

$worker = new \Resque\Worker(new \Resque\Resque(<some client>));

then the SIGQUIT does trigger a call to $worker->shutdown(). Strangely enough, doing the following:

$resque = new \Resque\Resque(<some client>);
$resque->setLogger(<some logger>);
$worker = new \Resque\Worker($resque);

then the SIGQUIT again behaves as expected and triggers a call to $worker->shutdown(). Any idea what's going on?