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` .