We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe.
My bean is defined with annotation:
@Module class AppModule { @Single(createdAtStart = true) fun sqlDriver() : SqlDriver { //... } }
I want to define bean/module close strategy to it. Effecitvely I want to run sqlDriver.close() during KoinApplication::close call.
sqlDriver.close()
KoinApplication::close
Describe the solution you'd like The design might be something like this:
@Module class AppModule { @Single(createdAtStart = true) fun sqlDriver() : SqlDriver { //... } @OnClose fun closeModule(sqlDriver: SqlDriver) { sqlDriver.close() } }
Describe alternatives you've considered If bean is AutoClosable the bonus design might be something like this:
AutoClosable
@OnClose(closeAutoClosable = true) @Single(createdAtStart = true) fun sqlDriver() : SqlDriver { //... }
But conflicts resolution strategy with @OnClose and close order of dependant beans must be designed additionally.
@OnClose
Target Koin project Koin-Annotations
The text was updated successfully, but these errors were encountered:
yes, definitely need to propose around closing definitions with onClose
onClose
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: