Created
August 15, 2019 11:23
-
-
Save agustarc/0cb25ebbf593b72654ab56dc215da8ff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class ImagesRepositoryImpl(private val source: ImageDataSource) : ImagesRepository { | |
override fun getImages(params: Map<String, String>): Single<Result<ImagesResponse>> { | |
return source.getImages(params) | |
.map { Result.success(it) } | |
.compose(applyRetryPolicy(TIMEOUT, maxRetries = 5, interval = 2, unit = TimeUnit.SECONDS) { Single.just(Result.failure(it)) }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment