Joost Klitsie

04/19/2021, 10:18 PM
Hello all! I have a question about multiple modules and Kodein: How can I import a Kodein.Module into every ktor module? 🙂 As I can only install a feature once, I would like to know how to add a Kodein modules per ktor module that I launch
The idea is that I can launch modules separately and they can communicate with each other through an httpClient. OR I can launch modules together and they should be able to communicate directly with each other. I have already achieved this by using separate sourcesets and using a sniff of reflection on application start, but I think it is not sexy enough.
I think it would be better to launch the app with separate modules, which can in theory communicate with each other
I could use
subDI(closestDI) {...}
but that would make every module a child of the base module
and therefore they cannot see each others dependencies