CacheTower icon indicating copy to clipboard operation
CacheTower copied to clipboard

Support for synchronous dispose

Open codingaddicted opened this issue 4 years ago • 4 comments

codingaddicted avatar May 11 '21 10:05 codingaddicted

First, thanks for opening a PR - I really appreciate it! I've had a quick look now but won't be able to give it a proper thorough review until a few days from now.

Turnerj avatar May 11 '21 14:05 Turnerj

Hi James, you're welcome! I'm using your work on a project and I'm happy to help consolidating the library. I'm still working on it since I found some issues on handling manifest files on flush and on multi-threaded operations on file-based caches, but I'm still investigating on them.

I also noticed that test with external dependencies are not working, probably they're missing some service dependency/env. variable (I only checked the added tests for working)

codingaddicted avatar May 11 '21 14:05 codingaddicted

Any update about this? Are this error may can be solved by this PR?

image

azhe403 avatar Jul 20 '22 11:07 azhe403

Hey @azhe403 - I hadn't heard anything back from the OP regarding my comments. There are now also some merge conflicts that would need to be fixed.

Generally speaking though, synchronous disposing shouldn't be required. The built-in DI stack can handle disposing of IAsyncDisposable though there is a caveat with that: If you are manually creating your own scope for DI, you need to use an AsyncServiceScope otherwise DisposeAsync won't be called.

Is there anything specific about your DI setup that isn't particularly standard? Any information you can provide that is tripping this issue would be helpful.

Turnerj avatar Jul 20 '22 13:07 Turnerj