php-resque
php-resque copied to clipboard
Add the ability to set custom Queue on Resque
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!
Hi @Avinash-Ravula, this should now work in v4, please see if that works for you.
@xelan Yup, it works! Thanks!
Great, thanks for your feedback😊