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

elizarov

12/15/2017, 10:59 AM
You can use
CompletableDeferred<Unit>()
as a latch. On one side you
await()
it, on the other you do
complete(Unit)
.
f

Fré Dumazy

12/15/2017, 11:35 AM
alright, tnx, this was what I needed. Is it possible to set a timeout value on this?
e

elizarov

12/15/2017, 1:58 PM
As usual.
withTimeout(...) { latch.await() }
f

Fré Dumazy

12/15/2017, 8:13 PM
of course, my bad facepalm
4 Views