-
Notifications
You must be signed in to change notification settings - Fork 6
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
job processing results #9
Comments
Indeed, that would be usefull... But only in the context of a job that has a hotjob... ?! There's currently a different signature in the next() callback... Quoting:
I'm not sure now, but I'm gonna examine if / why |
I don't think it will be useful only for Consider the following two use cases:
As for current callback = function(optErr, optRes, optCallback) {
if (typeof optRes === 'function') {
optCallback = optRes;
optRes = null;
}
...
}; |
I got a little confused with the first example and multiple statuses... If the job is not a hotjob, and we enable this feature, then we essentially add to kickq a "persistent storage service layer" which doesn't sound too sexy to my ears... It'll shift us out of focus and it really isn't kickq's responsibility to store application / worker data... There is one more issue to think of when considering this option, the Jobs lifetime. The default setting will permanently purge complete jobs after 1day. One can configure Kickq to purge the jobs the moment they complete... Having said that, i still think there is a case to be made for the hotjobs... altering the cb signature like you suggest will work just fine... What i currently have in my mind is that the data originating from the worker will never be stored in redis. They will only be transported through pubsub channels and if there's a hotjob that listens it'll pick them up... I'm trying to avoid storing worker generated data to redis as a design choice... update Changed phrasing a bit |
I thing you're right. I kept in mind the purge mechanism and never mean any persistency, though I missed the case with immediate purging. |
@thanpolas, you convinced me that this my suggestion is ill-suited for ordinary jobs, but it's still a good case for |
It's not actually an issue, it's more like a suggestion.
Sometimes you want to get the result of the job processing. So, it'll be great to have some option to store the results of the processing.
The results can be returned from the processing function through the promise:
or through the callback:
This result could be stored inside the job just like the
data
and returned along with the job itself through thehotjobPromise
or usingkickq.get
function..I don't think this option should be turned on by default, but sometimes it may be really useful.
The text was updated successfully, but these errors were encountered: