Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor perform method adjustment in Resque_Job class #3

Closed
dshorthouse opened this issue Oct 30, 2010 · 3 comments
Closed

minor perform method adjustment in Resque_Job class #3

dshorthouse opened this issue Oct 30, 2010 · 3 comments

Comments

@dshorthouse
Copy link

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.

@danhunsaker
Copy link
Contributor

@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?

@dshorthouse
Copy link
Author

I expected it can be closed. It was such an old issue, I've since migrated to (mostly) ruby :)

@jbrower
Copy link

jbrower commented May 9, 2013

@chrisboulton I concur that this can be closed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants