Hi folks, I'm new to using Koin. So I've pocked ar...
# koin-contributors
k
Hi folks, I'm new to using Koin. So I've pocked around the source code a bit and found some places I'd like to change. What's the best flow to discuss whether it should be done at all and to gain more context on why it was done this way in the first place? To create an issue and discuss questions there, or to create pull request and discuss there? Changes I'd like to propose mostly concentrate in
InstanceFactory
and code around it, specifically: 1. Changing upper type of generic T in
InstanceFactory
to
Any
- this prevents module definitions from returning null, especially when
SingleInstanceFactory
already uses null to check whether it was initialized; 2. Changing synchronization in
SingleInstanceFactory
and
SingleInstanceFactory
-
get
and
drop
aren't covered by synchronization, so theoretically race condition can happen; 3.
ScopedInstanceFactory::dropAll
does not call onClose callback, is this an intended behavior? 4. Remove
isCreated
method from
InstanceFactory
- it's really has to be used only in tests (it's not as common behavior of inheriting classes) and we can easily remove it; 5. Inline
KoinPlatformTools::synchronized
at least inside common module it can be inlined; 6. Add synchronization to `get`/`getOrNull` methods of native:`MutableGlobalContext` and jvm:`GlobalContext` .
Ooops, should've read readme, I'll create an issue
a
Hello @Konstantin can be interesting to talk about it. Koin 4.0 aims to bring new engine. That could be interesting to take a tour
I was wondering how to make it all coroutines
k
Hey @arnaud.giuliani, I was sidetracked a bit, trying to create demo where existing code might work incorrectly in multhithreaded environment. I'll get back when I'll be sure that it demonstrates issues I want to show 🙂 Do you have some overview document for koin 4.0? Regarding "all coroutines" sounds a bit too much. I presume most users would like to use Koin from non-suspend functions. Not sure what benefits such drastic change would provide.
a
Perhaps thinking of having a dedicated Github project to submit and document proposals / Roadmaps
I'm afraid of having it in the middle of issues and stuff 😛
For the engine, I was thinking about coroutines to simplify multithread part ... but just a thought 🤔