opensavvy.progress¶
The Progress interface hierarchy.
Overview¶
When storing progress events:
-
Progressrepresents both finished and ongoing tasks, -
Progress.Donerepresents finished tasks, -
Progress.Loadingrepresents ongoing tasks, -
Progress.Loading.Unquantifiedrepresents ongoing tasks for which no more information is available, -
Progress.Loading.Quantifiedrepresents ongoing tasks for which some information is available.
When reporting events, most of the code should use the done and the loading helpers.
Types¶
ExperimentalProgressApi¶
@RequiresOptIn(message = "This API is experimental and may be changed in the future. If you find it useful, please get in touch to share your use-case: https://gitlab.com/opensavvy/groundwork/pedestal/-/issues/new.")
annotation class ExperimentalProgressApi
Progress¶
sealed interface Progress
Is work currently happening?
Progressive¶
@ExperimentalProgressApi
data class Progressive<out Value>(val value: Value, val progress: Progress)
Functions¶
done¶
fun done(): Progress.Done
All scheduled work for this task has been done.
loading¶
Some scheduled work is ongoing, but we have no information on how much is left.
fun loading(progress: Double): Progress.Loading.Quantified
Some scheduled work is ongoing, and we can estimate the ratio of what has been done compared to what's left to do.