Periodic

@Serializable
data class Periodic(val taskId: String, val constraints: WorkConstraints = WorkConstraints(), val input: WorkInput = WorkInput.empty(), val ephemeral: Boolean = false, val interval: Duration, val flexWindow: Duration? = null) : WorkRequest

Repeats indefinitely until cancelled. Android floor is 15 minutes (validated by the scheduler at enqueue time); iOS / macOS have no system floor but we recommend ≥ 15 minutes for parity.

Constructors

Link copied to clipboard
constructor(taskId: String, constraints: WorkConstraints = WorkConstraints(), input: WorkInput = WorkInput.empty(), ephemeral: Boolean = false, interval: Duration, flexWindow: Duration? = null)

Properties

Link copied to clipboard
open override val constraints: WorkConstraints
Link copied to clipboard
open override val ephemeral: Boolean

If true, this request is cleared at app cold-start before any worker dispatches. Schedule it again from app code at a known-safe init point.

Link copied to clipboard

Execution flex window at the end of each interval. If non-null, the platform may fire the task anywhere in the final flexWindow of the period. Maps to androidx.work.PeriodicWorkRequest flex interval and macOS tolerance. iOS does not use this value (BGProcessingTaskRequest has no flex window).

Link copied to clipboard
open override val input: WorkInput
Link copied to clipboard

How often the scheduler should repeat this task. Must be >= 15 minutes (Android floor).

Link copied to clipboard
open override val taskId: String