<@U0BLRBFMM> Async dependencies might be a great u...
# coroutines
d
@salomonbrys Async dependencies might be a great use case for coroutines, one could do
launch(CommonPool) { inject(kodein) }
and inject the dependecies
bind<A> with singleton { awaitResult<A> { callback -> aFactory(callback) } }
where
awaitResult<T>
is a
suspend fun
... but it would still be great if I could find a way to use some kind of extension function for the
awaitResult
boilerplate which is just a generic wrapper for the classic callback for result pattern (which is used alot in Vert.x...) Slack Conversation
@elizarov I can't have a suspend function to retrieve the callback's result when I do the injection in Vert.x start. Like when I need an SQLClient initialized async...