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

Didier Villevalois

08/22/2021, 12:27 PM
Is there any reason that there is no
SendChannel<E>.sendCatching(e: E): ChannelResult<Unit>
like there is a
ReceiveChannel<E>.receiveCatching(): ChannelResult<E>
?
l

louiscad

08/22/2021, 9:22 PM
It's called
trySend()
d

Didier Villevalois

08/22/2021, 10:09 PM
@louiscad I mean there is a
receive
, a
receiveCatching
and a
tryReceive
with different semantics and behavior. However, there is only a
send
and a
trySend
, but no
sendCatching
. How is that? I would need a non-throwing and suspending version of
send
.
Or am I missing something?
4 Views