OneTimeJobRequest

A job that runs once.

val request = oneTimeJob(SyncJob, SyncInput(since = lastSync)) {
setConstraints(constraints { requiredNetworkType = NetworkType.CONNECTED })
setInitialDelay(10.seconds)
addTag("sync")
}

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val backoffDelay: Duration

Delay applied to the first retry.

Link copied to clipboard

backoffDelay in milliseconds, for callers without kotlin.time.Duration.

Link copied to clipboard
open override val backoffPolicy: BackoffPolicy

How the retry delay grows between attempts.

Link copied to clipboard
open override val constraints: Constraints

Device conditions required before the job may run.

Link copied to clipboard
open override val id: JobId

Identifier the job will be enqueued under.

Link copied to clipboard
open override val initialDelay: Duration

Delay before the first run.

Link copied to clipboard

initialDelay in milliseconds, for callers without kotlin.time.Duration.

Link copied to clipboard
open override val maxAttempts: Int

How many times the job may be started before it is given up on.

Link copied to clipboard
open override val tags: Set<String>

Tags used to observe or cancel groups of jobs.

Link copied to clipboard
open override val typeName: String

Name of the JobType this job belongs to.