reagento / dishka

Cute DI framework with agreeable API and everything you need
https://dishka.readthedocs.io
Apache License 2.0
356 stars 39 forks source link

Singleton invalidation #133

Open Tishka17 opened 4 months ago

Tishka17 commented 4 months ago

container.invalidate(Pool) to remove an object from cache so it can be recreated

Tishka17 commented 4 months ago

it's a dangerous call because there could be created objects which rely on the one we are trying to invaldate. Also, it's not clear whether we need to call finalizer or not (probably we can just add a parameter)

Tishka17 commented 4 months ago

a) close must clean all except context data so the container will be reused b) APP-container can be recreated from RUNTIME one

Tishka17 commented 3 months ago

Since version 1.2 you can call close to cleanup all dependencies and continue using same container