I want to perform an event every 10 minutes so I'm...
# coroutines
c
I want to perform an event every 10 minutes so I'm following this code. https://stackoverflow.com/questions/54827455/how-to-implement-timer-with-kotlin-coroutines
Copy code
val tickerChannel = ticker(delayMillis = 10 * 60_000, initialDelayMillis = 0)

repeat(10) {
    tickerChannel.receive()
    println("TIMER SUCCESS")
}
I want it to repeat forever though. I'm probably missing something dumb, but can I signify forever somehow, or do I have to use Integer.MAX_VALUE?
w
how about
while(true)
?
c
So just wrapping the repeat with a while statement. Or do you mean replacing the repeat statement with while?
w
Replacing repeat with while, that’s how I understand you want to it to work — receive from ticker channel forever