Return value of jobs

What do you think about storing the return value of jobs? I mean, when Hangfire finishes a job, it should store the returned value and then show it in the dashboard along other information about the successful run (latency, duration, etc.)

The result could be something like “Processed 1024 items”.

I have spent only few minutes looking into the source code but I would do it this way:

  1. Update InvokeMethod and Perform in Job.cs to return object instead of void.
  2. In PerformJobWithFilters in JobPerformanceProcess.cs, store the returned value into PerformedContext.
  3. Add a new filter that would store the returned value along other information about the job run.

This way, you could easily enable/disable the return value storing or change it any way you want.
I don’t know the architecture of Hangfire as well as you do, so, what do you think?
Would you accept a pull request if this was implemented?
Where would you suggest to store the returned value? To me, State.Data seems to be the best fit.

Edit: I have opened a pull request for this issue https://github.com/HangfireIO/Hangfire/pull/161

I’m totally agree with the usefulness of this feature and leaved the reply in PR. Thank you for this awesome contribution!