What's the difference between `send()` and `offer(...
# coroutines
l
What's the difference between
send()
and
offer()
when using
RendezVousChannel
apart from the fact that
offer()
is not suspended?
e
send
suspends until rendezvous is made, while
offer
returns
false
and does not do anything in this case
l
Are you sure it returns false? I swapped
launch(UI) { send(response) }
with
offer(response)
without breaking my WIP lib. Or maybe it returns
true
if there's already a
received()
call awaiting the rendez-vous and false otherwise ?
d
You don't need launch with offer since it's not suspending function..
l
@dave08 I know, that's not the question here
e
offer
returns true if it happens to make rendezvous and false otherwise. You are likely just to have good timing in your tests.