Skip to content

Instantly share code, notes, and snippets.

@lfmunoz
lfmunoz / TaskDecider.kt
Last active September 27, 2019 15:19
TaskDecider
import kotlin.random.Random
/**
* This class holds state about when a task was last
* executed and helps determining if it should execute again or not
* depending on configuration and the current time
*/
class TaskDecider(
private val taskIntervalMillis: Long,