ProgressScope
The receiver scope of an asyncWithProgress block: a CoroutineScope that can report progress and divide the remaining bar into sequential slices.
report may be called from any thread. slice must be called sequentially from the job's own flow; slices are windows allocated left to right, not a concurrent tree. For parallel work, route completions through report(done, total), whose counter is monotonic.
Functions
Link copied to clipboard
fun <T> CoroutineScope.asyncWithProgress(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend ProgressScope.() -> T): ProgressFuture<T>
Starts a coroutine like async and returns a ProgressFuture that reports its progress.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun CoroutineScope.launchPeriodic(interval: Duration, initialDelay: Duration = Duration.ZERO, action: suspend () -> Unit): Job
Launches a coroutine that runs action repeatedly with a fixed pause between runs.