arrow-fx / arrow.fx / Timer

Timer

interface Timer<F>

Timer allows to sleep for a Duration in F. This behaviour can be derived from Concurrent, and can be used to implement backing off retries etc.

Since sleeping is done by Timer it allows for easy modification in testing by providing a no-op TestTimer

Functions

sleep Sleeps for a given duration without blocking a thread.abstract fun sleep(duration: Duration): Kind<F, Unit>

Companion Object Functions

invoke operator fun <F> invoke(CF: Concurrent<F>): Timer<F>

Do you like Arrow?

Arrow Org
<