You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In addition to just passing worker args by reference, I have use for the actual job id in a worker class. Similar to a Resque_Job_Status class, I have a Resque_Job_Message class that populates and updates a key/value. Throughout the course of a job when a worker has it, I update the value for this key to provide some human-readable feedback (e.g. "Job has started" / "Job is now doing 'x'" / "Job is now doing 'y'" / etc.). Thus, it is handy for a worker to know what is the job id.
The text was updated successfully, but these errors were encountered:
@dshorthouse: Your job should have access to the payload array already - at least, I've been able to reference the job ID in my own code: $this->job->payload['id'] I guess this may have been different when the issue was created, but it does seem to be working now. Should this issue be closed?
Any harm adding:
$instance->id = $this->payload['id'];
...to the perform method in the Resque_Job class?
In addition to just passing worker args by reference, I have use for the actual job id in a worker class. Similar to a Resque_Job_Status class, I have a Resque_Job_Message class that populates and updates a key/value. Throughout the course of a job when a worker has it, I update the value for this key to provide some human-readable feedback (e.g. "Job has started" / "Job is now doing 'x'" / "Job is now doing 'y'" / etc.). Thus, it is handy for a worker to know what is the job id.
The text was updated successfully, but these errors were encountered: