1.2.0-beta1
Pre-releaseRelease Notes
Hangfire.Autofac now resolves service instances using a child, tagged lifetime scope. Added shared instance and deterministic disposal features support allowed by the new JobActivatorScope
abstraction introduced in Hangfire 1.5.0-beta1.
Please see the updated README.md file for the details.
Updating
Ownership of all the resolved components moved to Autofac, ownership in this case means the party which is responsible to call the Dispose
method on IDisposable
instances. Now Autofac itself is responsible for disposing the resolved components.
Previously job type instances (i.e. an instance of a type parameter passed to Enqueue
, Schedule
, etc. methods) were owned by Hangfire itself and thus the Dispose
method was called by Hangfire. It was also beleived that your job type is responsible for disposing all the passed dependencies (through the constructor or properties).
Now, as the ownership moved, it is not necessary to call the Dispose
method on the dependencies – it will be called automatically by Autofac (if appropriate). So your Dispose
methods may be called multiple times, but generally this is not a problem.