Since version 1.7.8 it is possible to pass results from parent job to continuation jobs in Hangfire. However there is no documentation or example supplied. While browsing code I realized that I need to use ContinuationsSupport
attribute with pushResults: true
argument. But i have no idea how Hangfire saves the result and then how do I access the result. I can't catch up with the code inside the attribute's class.
It appeared that it is enough to use the attribute with pushResults
equal to true and then set the return type of the function to e. g. string
. Then one can access this value produced by parent in continuation jobs by invoking context.GetJobParameter<SomeType>("AntecedentResult")
where context
is PerformContext
(supplied by hangfire)