https://kotlinlang.org logo
Title
l

louiscad

12/14/2017, 1:28 PM
What's the difference between
send()
and
offer()
when using
RendezVousChannel
apart from the fact that
offer()
is not suspended?
e

elizarov

12/14/2017, 2:44 PM
send
suspends until rendezvous is made, while
offer
returns
false
and does not do anything in this case
l

louiscad

12/14/2017, 3:18 PM
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

dave08

12/14/2017, 5:20 PM
You don't need launch with offer since it's not suspending function..
l

louiscad

12/14/2017, 6:37 PM
@dave08 I know, that's not the question here
e

elizarov

12/14/2017, 6:43 PM
offer
returns true if it happens to make rendezvous and false otherwise. You are likely just to have good timing in your tests.