That just burns CPU while it waits. Are you sure y...
# coroutines
e
That just burns CPU while it waits. Are you sure you want that?
j
I definitely don’t. And with @bj0’s suggestion, I’m using this instead (which seems to do the trick):
Copy code
suspend fun <T> ConflatedBroadcastChannel<T>.valueOrWait(): T {
    consume {
        return this.first()
    }
}
I originally misunderstood what
consume
was doing, which is why I avoided it.