Koin Annotations - About Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform insert-koin.io
154
stars
40
forks
source link
Add bean/module destructor for Annotation-defined bean/module #112
Open
vdshb opened 8 months ago
Is your feature request related to a problem? Please describe.
My bean is defined with annotation:
I want to define bean/module close strategy to it. Effecitvely I want to run
sqlDriver.close()
duringKoinApplication::close
call.Describe the solution you'd like The design might be something like this:
Describe alternatives you've considered If bean is
AutoClosable
the bonus design might be something like this:But conflicts resolution strategy with
@OnClose
and close order of dependant beans must be designed additionally.Target Koin project Koin-Annotations