I have an OkHttp Interceptor that makes another re...
# squarelibraries
m
I have an OkHttp Interceptor that makes another request before the original request can proceed (think authentication). Sometimes I make many requests at once, exceeding the
maxRequestsPerHost
in the Dispatcher, meaning the Interceptor cannot make it's request, because
maxRequestsPerHost
is already at limit. No request can finish, because they are waiting at the Interceptor, and I have a deadlock. This seems like a problem that should be pretty common, so what is the proper solution here? • Make the inner request with a different Dispatcher? • Somehow make sure I don't reach my
maxRequestsPerHost
, so there is always room for the inner request? • Move the inner request out of the Interceptor somehow? (Maybe there is some mechanism I don't know about where I can hook into the request before it's counted in
maxRequestsPerHost
)?