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

Paul Woitaschek

12/01/2017, 1:50 PM
I'm really just interested in the latest offer
d

dave08

12/03/2017, 7:36 AM
If the latest offer is not getting received as expected, you could try using
runBlocking { channel.send(...) }
instead... offer wont send anything on a conflated channel if any of your 10 sec. functions are still running after cancel while offer is trying to send something (you can test this by logging offers return value, if its true it got sent...). So you might not be getting even the latest offer... its a bit tricky, just make sure the behavior is really what youre expecting.
I take that back, conflated keeps a buffer of 1, so youre ok. In my use case i needed something else, so i was having those problems... 😄
3 Views