Simple way to have a closure execute 250.milliseco...
# announcements
t
Simple way to have a closure execute 250.milliseconds in the future? Looking for the Kotroid equivalent of the Swiftios DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(250)) { Foo().makeABar() }
m
Copy code
launch{
 delay(250)
 action()
}
btw, what is
Kotroid
?
t
Kotlin <-> Android
This appears to be kolinx.coroutines thing? can/should I use that in an android environment?
👌 2
a
Yes, because structured concurrency makes it much easier to get cancellation right when your lifecycle scope is no longer valid
☝️ 1