SequentialJob

A helper class that manages a single Job. When a new job is launched, any previous job is cancelled. This is useful for ensuring that only the latest operation of a certain type is running at a time (e.g. for search or settings updates).

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun cancel()

Cancels the current job.

Link copied to clipboard
fun launch(scope: ERROR CLASS: Symbol not found for CoroutineScope, timeoutMs: Long = 0, block: suspend ERROR CLASS: Symbol not found for CoroutineScope.() -> Unit)

Cancels the previous job (if any) and launches a new one in the given scope. The new job uses handledLaunch to ensure exceptions are reported.