core / pragma.jobs / BackgroundManager / runForever /

runForever #

abstract fun runForever(functor: suspend () -> Unit, functorDelay: Long): Job

Runs the functor periodically with a delay.

If the functor throws an exception it will be logged as an error containing the functor name but will still continue to run the functor on the delay. runForever will only stop executing the functor after shutdown is called.

Parameters #

functor

The functor to run periodically.

functorDelay

The delay in ms between runs of the functor.