php-resque icon indicating copy to clipboard operation
php-resque copied to clipboard

Add the ability to set custom Queue on Resque

Open Avinash-Ravula opened this issue 1 year ago • 1 comments

Problem: We have a static property $queue in Resque.php which will be used by Worker while processing the jobs. But, we do not have a way to override the Resque to use our own custom Queue class derived from Resque\Queue instead.

Solution: Please add setQueue method on the Resque.php or make $queue variable to be public so that we can easily override and tweak the behavior as required. I currently need to use php-di for dependency injection while creating a new job instance.

I can do a PR as well if you would like me to. Thanks!

Avinash-Ravula avatar May 05 '23 07:05 Avinash-Ravula

Hi @Avinash-Ravula, this should now work in v4, please see if that works for you.

xelan avatar Sep 13 '23 09:09 xelan

@xelan Yup, it works! Thanks!

AvinashRavula avatar Apr 02 '24 13:04 AvinashRavula

Great, thanks for your feedback😊

xelan avatar Apr 02 '24 13:04 xelan