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

Keeping track of Process status as well as result #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Keeping track of Process status as well as result #134

wants to merge 1 commit into from

Conversation

ashishtilara
Copy link

  • if the "Perform()" function returns result, store it along with process status
  • return process status+result in Resque_Job_Status->get()
  • allow user to delete the status from redis
  • allow user to query result of the job

- if the "Perform()" function returns result, store it along with process status
- return process status+result in Resque_Job_Status->get()
- allow user to delete the status from redis
- allow user to query result of the job
@danhunsaker
Copy link
Contributor

Sorry for the delay - meant to chime in sooner.

Upon further research, I discovered that part of my previous advice (in PR #132) was incorrect - specifically, this change doesn't affect the Resque Web interface one whit. Apparently, job status (as well as job stats, though that's another story altogether) isn't one of the things Ruby Resque tracks. So that argument against accepting and merging this PR is invalid.

In fact, this kind of functionality is actually available in Ruby Resque 1.8 via the resque-result plugin. So there's precedent for accepting this kind of modification into the project. Especially since PHP-Resque doesn't encourage plugins in the same way the Ruby version does - though it supports them, since it provides the same (or at least a very similar) hook system.

Ultimately? One of my projects handles all of this by having a parent class for all jobs that stores results in Redis as part of the tearDown() method. This is a more robust solution for what I am doing because I need a lot more data about the job itself when I go to process its results, but by no means is it the right solution, especially in cases less highly specialized than mine. So this sounds like a really useful feature to me. It allows developers to write their perform() methods using the standard PHP approach of returning output to the calling function, rather than storing it someplace for later retrieval by a different method. So essentially, 👍!

@arturo-c
Copy link

Looks ok 👍

danhunsaker added a commit to resque/php-resque that referenced this pull request Dec 11, 2018
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

Successfully merging this pull request may close these issues.

3 participants