chrisboulton / php-resque

PHP port of resque (Workers and Queueing)
MIT License
3.43k stars 759 forks source link

allow users to use a credis native setup #367

Open scones opened 6 years ago

scones commented 6 years ago

... instead of testing an unused variable

this change allows us to pass a credis_cluster object as $server and thus use a preconfigured sentinel setup. and it is already tested in production

best regards.

danhunsaker commented 6 years ago

Seeing as the current code lets you do the same exact thing by passing the object as the third argument instead of the first... Without modifications... This change is a backwards compatibility break, and doesn't actually add anything that isn't already there, so it probably won't be merged.

scones commented 6 years ago

The only place i can locate, where Resque::$redis is assigned, seems to be here: https://github.com/chrisboulton/php-resque/blob/968b7e6a307a2079051dfc571d2fc2be0546209f/lib/Resque.php#L62 (and maybe two lines above that).

You might notice the apparent lack of a third argument.

So yes, the current implementation of Resque_Redis does allow for a native setup, but the current implementation of Resque does not.

But i am always open for a configuration example with the current release that can use a sentinel setup.

danhunsaker commented 6 years ago

Let me rephrase, then. If the issue is that nothing is actually passing the third argument to the Resque_Redis constructor, then the correct fix is to update the calling code to make use of this parameter, rather than negate its very existence by changing the one pair of lines that uses it.