rate Limit Host
Deprecated
Use the version with kotlin.time APIs instead.
An OkHttp interceptor that handles given url host's rate limiting.
This uses Java Time APIs and is the legacy method, kept for compatibility reasons with existing extensions.
Examples:
httpUrl = "https://api.anime.com".toHttpUrl(), permits = 5, period = 1, unit = seconds => 5 requests per second to api.anime.com httpUrl = "https://cdn.thumbnails.com".toHttpUrl(), permits = 10, period = 2, unit = minutes => 10 requests per 2 minutes to cdn.thumbnails.com
Since
extension-lib 13
Parameters
HttpUrl The url host that this interceptor should handle. Will get url's host by using HttpUrl.host()
Int Number of requests allowed within a period of units.
Long The limiting duration. Defaults to 1.
TimeUnit The unit of time for the period. Defaults to seconds.
Deprecated
Default rate limiting implementation is no longer provided. Source developers are now responsible for implementing their own rate limiting logic if desired, to prevent forks from bypassing it.
Replace with
this
An OkHttp interceptor that handles given url host's rate limiting.
Examples:
httpUrl = "https://api.anime.com".toHttpUrl(), permits = 5, period = 1.seconds => 5 requests per second to api.anime.com httpUrl = "https://cdn.thumbnails.com".toHttpUrl(), permits = 10, period = 2.minutes => 10 requests per 2 minutes to cdn.thumbnails.com
Since
extension-lib 14
Parameters
HttpUrl The url host that this interceptor should handle. Will get url's host by using HttpUrl.host()
Int Number of requests allowed within a period of units.
Duration The limiting duration. Defaults to 1.seconds.
Deprecated
Default rate limiting implementation is no longer provided. Source developers are now responsible for implementing their own rate limiting logic if desired, to prevent forks from bypassing it.
Replace with
this
An OkHttp interceptor that handles given url host's rate limiting.
Examples:
url = "https://api.anime.com", permits = 5, period = 1.seconds => 5 requests per second to api.anime.com url = "https://cdn.thumbnails.com", permits = 10, period = 2.minutes => 10 requests per 2 minutes to cdn.thumbnails.com
Since
extension-lib 14