Erich Oswald
05/19/2025, 2:26 PMRequestScope
in Koin 4.1. However, I was a bit disappointed when I first tried it because it doesn't provide any access to the actual ApplicationCall
. My use case would include that I can e.g. derive a current user from the call's principal and inject that current user into new service instances.
A possible solution (that so far works for me in a custom plugin) is to pass the current call
to the created scope object and in turn pass it on to createScope.
This allows me to use getSource
in my scoped
blocks to access the current application call. Would you consider including something like this in the standard RequestScope
?arnaud.giuliani
05/19/2025, 2:28 PMarnaud.giuliani
05/19/2025, 2:38 PMApplicationCall
objectErich Oswald
05/19/2025, 2:39 PMcall.application
anyway, so you might not even need to pass it separately anymore.arnaud.giuliani
05/19/2025, 2:46 PM