Skip to content

retry suspend

milan edited this page Jun 7, 2023 · 2 revisions

//app/org.mjdev.balldontlie.base.helpers/Ext/retrySuspend

retrySuspend

[androidJvm]
suspend fun <T> retrySuspend(retryDelay: Long = ListPagingSource.DEFAULT_RETRY_DELAY, maxRetryCount: Int = ListPagingSource.DEFAULT_MAX_RETRY_COUNT, condition: T.() -> Boolean, block: suspend () -> T): T

Function made calls until retry count is not 0. As a result it give block call result or Unit, if retry count is 0.

Return

T

Parameters

androidJvm

retryDelay Retry delay
maxRetryCount Max retry count
condition Condition
block code that is run maxRetryCount times, delayed retryDelay ms, until condition reached true.
T T return value
Clone this wiki locally