I'm using ticker function to create a repeating task which repeats after 1 min. I have the receive part of the code done. But the problem is in the apply part. Where do I sent the function which calls the apply code of the ticker?
The ticker itself is running inside a while loop.
otakusenpai
10/19/2018, 7:52 AM
Copy code
val tickUpdater = ticker(60,0)
while(true) {
// do something
withTImeoutOrNull(60) { tickUpdater.receive() }
}
Where do I apply this function
Copy code
suspend fun updateTickList() {
tickUpdater.apply {
// do something
}
}