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

Better handling of deterministic disposal feature #3

Open
odinserj opened this issue Jul 13, 2016 · 0 comments
Open

Better handling of deterministic disposal feature #3

odinserj opened this issue Jul 13, 2016 · 0 comments

Comments

@odinserj
Copy link
Member

Currently the following method is used to dispose all the requested services, when background job is completed. This method gracefully handles transient dependencies, but it also disposes singleton services that implement the IDisposable interface.

public override void DisposeScope()
{
    _kernel.Components.Get<ICache>().Clear(JobActivatorScope.Current);
}

It's worth to read this article to know how to correctly implement deterministic disposal with Ninject: http://mono.software/2016/04/21/Ninject-ambient-scope-and-deterministic-dispose/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant