https://kotlinlang.org logo
#coroutines
Title
# coroutines
c

Circusmagnus

12/23/2020, 12:35 PM
Is it possible to check whether sending to Channel will suspend without actually sending anything? I know, that there is
isFull()
function on SendChannel, but that is depracated without replacement
Or maybe it is considered no-go approach. Channel is concurrent, and whatever info you may get from isFull() may not be relevant in a nanosecond?
b

bezrukov

12/26/2020, 7:29 AM
You can use
channel.offer(value)
if it returned false suspension required. Otherwise it was sent
6 Views