withProgress

fun <T> Deferred<T>.withProgress(progress: StateFlow<Progress>): ProgressFuture<T>

Adapts an existing Deferred and an external progress StateFlow into a ProgressFuture.

Use it to wrap an API that already exposes both halves, such as a Ktor download whose onDownload callback feeds a MutableStateFlow.