-
Notifications
You must be signed in to change notification settings - Fork 92
Patched for cakePHP3: #34
base: master
Are you sure you want to change the base?
Conversation
- Resque_Job_Creator can return an array containing the class instance, the class method to invoke and the arguments to be passed to it, and the beforePerform and tearDown methods' names Improved Exceptions message expliciting "Resque_Job_Creator not loaded"
…antiated by the Resque_Job_Creator class (for CakePHP the args property equals the argv from the CLI that include as 0th element the script file name, this must be mocked inside the Resque_Job_Creator class)
…esque::getWorkers()) STDOUT is not defined.
…e then logged for debugging purpose
$instance = $this->getInstance(); | ||
if (is_array($instance)) | ||
{ | ||
if (isset($instance[4])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this sorcery? These seem to be magic numbers. I've no idea what these things mean :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are a way to allow helper class Resque_Job_Creator to be more flexible and use variable names for "perform" , "setUP" and "tearDown" methods to better match underneat job classes
For example to use CakePHP shells as jobs: wa0x6e/Cake-Resque#92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, you're saying that if Resque_Job_Creator
returns an array, then it'll override some settings?
I'm not sure if this is the way you want to go about things... I mean - why not just have something like
public function setUp()
{
return $this->realSetUp();
}
public function perform($args)
{
return $this->realPerform($args);
}
I'm really not a fan of this, and think it goes significantly against the original design of resque.
Can I see a use case for when this would actually be useful? Because I can only think of horrendously convoluted examples.
A few changes I made to actually be able to let Jobs be correctly executed as CakePHP 3 Shells.
These goes together with the PR#92 on Cake-Resque
Main things: