reportProgress

suspend fun reportProgress(progress: Float, message: String? = null)

Reports progress from within a task handler.

Emits a TaskState.Running with progress info to TaskMonitor, which flows to any active observers.

kmpWorker.registerWithContext("upload") {
for (i in 0..100 step 10) {
reportProgress(i / 100f, "Uploading chunk $i")
delay(500)
}
}

Parameters

progress

Percentage complete (0.0–1.0).

message

Optional human-readable status.