Shouldn't be handy to add a timeout parameter to `...
# coroutines
p
Shouldn't be handy to add a timeout parameter to
flow.lastOrNull()
or
flow.firstOrNull()
operators. Isn't more elegant than surrounding it with
withTimeoutOrNull {}
y
Where do we stop though? Should every terminal operator have it too? Also, the timeout is a more general coroutine mechanism, so it makes sense that it'd be provided thru a general function. (I don't mean to come off strong. At the end of the day, you can define your own extensions; that's the beauty of Kotlin)
☝️ 4
👍 1
☝🏽 1
p
I see, yeah it makes a whole lot of sense.
y
This is a good read on how jetbrains think about which utilities to add as first class https://github.com/Kotlin/kotlinx.coroutines/issues/4212
p
Much appreciated 👍