Created
April 9, 2019 07:43
-
-
Save Unlimity/b6d9f139b650b267ae1378a0c03203f9 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
val client = NinjatoOkHttpClient(okHttpClient) { | |
retryPolicy = MyRetryPolicy() | |
fallbackPolicy = MyFallbackPolicy() | |
retryPolicy { request, throwable -> | |
if (request.retries > 3) Retry.DoNotRetry else Retry.WithoutDelay | |
} | |
fallbackPolicy { request, throwable -> | |
request.also { it.baseUrl = "https://anotherServer.com" } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment