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

blakelee

06/07/2019, 7:58 PM
Is there a CompletableDeffered with a reset? Such as, once I get my result, I can choose to reset it so that if I want to call await() again it has to wait for a new value. Or perhaps I’m just looking for a different class
b

bdawg.io

06/08/2019, 4:17 AM
Deferred
is isolated from how the value is being obtained, so it's not resettable unfortunately. The Flow/generic suspend function should fill your needs though
l

louiscad

06/08/2019, 6:23 AM
A Channel with a capacity of 1, 0 or conflated should fit your needs
3 Views