Ivan “CLOVIS” Canet
Ivan “CLOVIS” Canet
> Threads have states and special purposes (for example, UI threads should not connect to databases). For example, code running in a EmptyCoroutineContext uses Dispatchers.Default instead of using the current...
Can you clarify how `stateIn` solves this issue? ```kotlin // The method we want to cache suspend fun foo() { … } // Declaration-time, no access to a CoroutineScope val...
So something like, ```kotlin fun lazyAsync( coroutineContext: CoroutineContext = EmptyCoroutineContext, block: suspend CoroutineScope.() -> Unit, ): Deferred = LazyDeferredImpl(coroutineContext, block) private class LazyDeferredImpl( private val additionalContext: CoroutineContext, private val initializer:...
@dkhalanskyjb I thought about it and reviewed my existing usages, and I can't manage to convince myself either way. - Having an auth marker in the context: in some projects,...
I'm not familiar with the internals of Ktor, and I don't really understand how `OutgoingContent` is supposed to be use. As a user, I really just want to be able...
But then you have to choose which `OutgoingContent` implementation to use yourself, no? You lose all the helpers around KotlinX.Serialization etc :thinking: I like the syntax with `TextContent`, but you...
Ah, that's a good point. Theorically, I could implement my own thing as a subtype of `OutgoingContent`, and use that. I'll try it and see what happens.
> I'm not sure what you mean. If the write operation requires a value, then how can it be invoked without the value being available? If some processes need to...
Oh, you're right, Arrow's `awaitAll` seems to be exactly this feature. Looking at your example, it works because of `coroutineScope` has a contract? I would have expected to need `lateinit`...
Would you consider adding this functionality to KotlinX.Coroutines itself? Other than this, all other discussion points have been addressed.